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

Fixed support for maxAge=0 #158

Merged
merged 1 commit into from Nov 4, 2018
Merged

Fixed support for maxAge=0 #158

merged 1 commit into from Nov 4, 2018

Conversation

tomarad
Copy link
Contributor

@tomarad tomarad commented Nov 4, 2018

Hey,
According to this spec when Access-Control-Max-Age is not set, it is up to the user agent to decide the value.
The check options.maxAge is faulty when maxAge equals to zero, causing it to return null, not 0 and different behaviors on different browsers.

Thanks!
Tom

Copy link
Contributor

@dougwilson dougwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! Can you add a test to our test suite as well? It will prevent accidentally regressing the behavior.

Let us know if you need help adding the test if needed 👍

@tomarad
Copy link
Contributor Author

tomarad commented Nov 4, 2018

Sure, added one :)

@dougwilson dougwilson self-assigned this Nov 4, 2018
@dougwilson dougwilson merged commit 01477dc into expressjs:master Nov 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants