-
-
Notifications
You must be signed in to change notification settings - Fork 883
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
Can't pass 'always' parameter to add_header due to single quoting #1020
Comments
If you're able, can you test #992 ? |
Indeed, this does appear to work! I expected it would not. I just have to modify my puppet-side code to not use the double quotes: Then i get this in the config: add_header 'Access-Control-Allow-Origin' "* always"; And Chrome appears to get the star, properly, and not the 'always'. So it's still a breaking change from my previous config where i had my own double quotes around the star. thanks! |
I suppose this parameter should be validated with a regex to ensure that the user isn't passing a nonescaped quote/ double quote. Since that breaks nginx when it's quoted again. |
@benh57 Yeah, though see the comments from @xaque208 in that issue, my reading is that maybe double quotes aren't legal in header values anyway? I'm a bit worried that adding such validation might almost be a cure that's worse than the disease? I'm hoping someone will merge that issue soon, since it seems like at least an improvement over the current situation. |
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
}
What are you seeing
Results in config:
add_header 'Access-Control-Allow-Origin' '"*" always';
Which breaks in Chrome:
The 'Access-Control-Allow-Origin' header contains multiple values '"*" always', but only one is allowed.
What behaviour did you expect instead
This formerly generated:
add_header 'Access-Control-Allow-Origin' "*" always;
Any additional information you'd like to impart
Related to #991
The text was updated successfully, but these errors were encountered: