lynndylanhurley/ng-token-auth — pull request #34 by booleanbetrayal (2014-09-10 19:54:57+00:00)
Title: fix(headers): fix strict object keys check for angular.extend in 1.3.0.rc1

As of Angular 1.3.0-rc.1, [angular.extend now requires that all arguments must be valid objects](https://github.com/angular/angular.js/commit/9bedeb3353969fba631ad9164edea3c38059fbda). Otherwise, exceptions are thrown such as:

TypeError: Object.keys called on non-object
at Function.keys (native)
at extend (app.min.js:424:25)
at mergeHeaders (app.min.js:8592:22)
at $http (app.min.js:8514:21)

The current IE ajax caching workaround (not familiar with the issue) breaks this by putting strings into the header object that is assumed to contain valid objects.

# disable IE ajax request caching for each of the necessary http methods
angular.forEach(httpMethods, (method) ->
$httpProvider.defaults.headers[method] ?= method
$httpProvider.defaults.headers[method]['If-Modified-Since'] = '0'
)

This PR fixes this issue by assigning an empty object literal instead.