Skip to content

Commit

Permalink
fix: invalid characters in the headers on Node 5.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thorn0 committed Feb 10, 2016
1 parent 9f13b55 commit 152337d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/middleware/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var createServeFile = function (fs, directory, config) {
var setNoCacheHeaders = function (response) {
response.setHeader('Cache-Control', 'no-cache')
response.setHeader('Pragma', 'no-cache')
response.setHeader('Expires', (new Date(0)).toString())
response.setHeader('Expires', (new Date(0)).toUTCString())
}

var setHeavyCacheHeaders = function (response) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/middleware/karma.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ describe('middleware.karma', () => {
})

it('should send non-caching headers for context.html', (done) => {
var ZERO_DATE = (new Date(0)).toString()
var ZERO_DATE = (new Date(0)).toUTCString()

includedFiles([])

Expand Down
2 changes: 1 addition & 1 deletion test/unit/middleware/source_files.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('middleware.source_files', function () {
})

it('should send no-caching headers for js source files without timestamps', function () {
var ZERO_DATE = new RegExp(new Date(0).toString().substring(0, 33).replace(/\+/, '\\+'))
var ZERO_DATE = new RegExp(new Date(0).toUTCString())

servedFiles([
new File('/src/some.js')
Expand Down

0 comments on commit 152337d

Please sign in to comment.