add optional feature to check modified file modified time to return 304#23
add optional feature to check modified file modified time to return 304#23avimar wants to merge 3 commits into
Conversation
|
(Just to note, this effectively ignores bad if-modified-since headers, it won't trigger an error.) |
|
@avimar Windows 7 here as well, following script: Returns 491 for me. |
|
@Dzitu Interesting! I don't know if that will ever change.. var fs=require('fs');
var stat = fs.statSync('myFile');
console.log(new Date(stat.mtime).getMilliseconds());
//769
console.log(new Date(stat.mtime).valueOf())
//1449737820769
console.log(Date.parse(stat.mtime))
//1449737820000 <-- no milliseconds |
| if (opts.charSet) { | ||
| var type = res.getHeader('Content-Type') + | ||
| '; charset=' + opts.charSet; | ||
| res.setHeader('Content-Type', type); |
There was a problem hiding this comment.
Will this override the res.set('Content-Type') from before? If so, perhaps they should be using the same method?
There was a problem hiding this comment.
I don't know: I only moved that code, I didn't write it. It looks like it appends it to the current content-type.
|
I added a few comments. I'd love to see a test or two for this change as well. |
|
@micahr is tests holding this up? |
|
@micahr - I addressed your comments. What now? |
|
@avimar the only thing left now is to add some unit tests for the new behaviour. |
|
Hey @avimar, It looks like @yunong requested tests a while back, though you were caught up on the testing framework and requested assistance. We are in the process of moving the plugins back into the main repo. If this work is still important to you, please re-open a PR over on that repo and I would be more than guide you through putting together some tests ❤️ |
restify/node-restify#994
#17
@Dzitu what version of windows return milliseconds? My Windows 7 always ends with
000meaning it's only accurate to seconds.