Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with datejs #3233

Closed
jpettitt opened this issue Mar 2, 2017 · 3 comments
Closed

Incompatibility with datejs #3233

jpettitt opened this issue Mar 2, 2017 · 3 comments
Assignees
Labels

Comments

@jpettitt
Copy link

jpettitt commented Mar 2, 2017

Not really an express bug. Opening issue here for the sake of others wondering why their code broke.

If you install datejs it modifies the stock Date.parse() function to handle more date formats. Unfortunately it now returns null instead of NaN and that breaks conditional request handling in express.static causing spurious 412 errors.

datejs Issue abritinthebay/datejs#263

@dougwilson
Copy link
Contributor

Weird for sure. Not sure if anything can be done there, since there is the potential for anything to overwrite the global Date object to anything. It's hard to program it to assume the entire environment can't be trusted to conform to the spec...

@dougwilson
Copy link
Contributor

There have been a few more issues related to this, all traced back to this datejs issue. I'm gearing up a 1.15.1 release to include a work-around.

@dougwilson dougwilson self-assigned this Mar 5, 2017
@dougwilson dougwilson added the 4.x label Mar 5, 2017
@dougwilson
Copy link
Contributor

So there is yet another issue with datejs: the Date.parse it overrides in the environment not only incorrectly returns null instead of NaN, it also returns an instanceof Date instead of a plain number when it succeeds... see conversation in pillarjs/send#130 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants