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

Allow array of conditions as options.origin #50

Closed
wants to merge 5 commits into from
Closed

Allow array of conditions as options.origin #50

wants to merge 5 commits into from

Conversation

alex94cp
Copy link
Contributor

This PR fully addresses #42. It allows options.origin to be an array of all types currently supported in options.origin (String and RegExp). Unit tests added.

@@ -12,23 +12,54 @@
preflightContinue: false
};

function varyHeadersOn(vary, headers) {
Copy link
Member

Choose a reason for hiding this comment

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

@alex94puchades I'm a bit confused on what this function is doing. can you walk me through it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@troygoode It appends a vary header with the passed fields as value. It's easier when used like this:

varyHeadersOn('Origin', headers); // intended to read as varyHeadersOnOrigin(headers)

Its only use is not having to repeat all the key-value vary header boilerplate.

@troygoode
Copy link
Member

@alex94puchades thanks for the PR. I've pushed up some new commits (fcd2b56 and 8ec22a9) that are based on this PR but with some small tweaks. publishing to npm as version 2.7.0

@troygoode troygoode closed this May 28, 2015
@expressjs expressjs locked as resolved and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants