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

Resolving issue #803 by adding quotes around the parameters #804

Merged
merged 1 commit into from
May 13, 2016

Conversation

Spechal
Copy link

@Spechal Spechal commented May 10, 2016

Fixes #803

@Spechal
Copy link
Author

Spechal commented May 10, 2016

Closing to force rebuild -- Travis CI errored

@Spechal Spechal closed this May 10, 2016
@Spechal Spechal reopened this May 10, 2016
@jfryman
Copy link
Contributor

jfryman commented May 11, 2016

Well, there is a dependency on Ruby 2.x now with this google-api-client, which is causing the tests to fail. Need to take a look at this...

@3flex
Copy link
Contributor

3flex commented May 13, 2016

If you try a rebuild now it should work.

beaker depends on google-api-client, which as of 0.9.5 requires Ruby 2. But beaker released a new version a couple of days ago which forces google-api-client 0.9.4 and lower, which doesn't have a specific Ruby requirement.

The gem dependencies should be updated in Travis so they don't rely on beaker, since the acceptance tests aren't run there.

@3flex
Copy link
Contributor

3flex commented May 13, 2016

Hmm, a rebuild didn't work, it's still loading the problematic gem... Merging this anyway since the problem is definitely with the CI config.

Hopefully the merge triggers a fresh build in master and the problem goes away, but if not I'll create a PR and try and fix up the Gemfile.

@3flex 3flex merged commit cba946b into voxpupuli:master May 13, 2016
@Spechal
Copy link
Author

Spechal commented May 13, 2016

Thanks for the merge. I received another message asking for justification as the nginx docs don't mention needing quotes.

Without this merge, the following add_header will fail:

add_header Access-Control-Allow-Methods GET, POST, OPTIONS;

It results in nginx: [emerg] invalid number of arguments in "add_header" directive in...onf:6

Adding quotes: add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';

The problem is resolved.

@bryangwilliam
Copy link
Contributor

I am seeing issues with this change when using add_header to insert a Content-Security-Policy header. The CSP syntax uses single-quotes, which clash with the single-quotes surrounding the header value in the template. Is there any reason for using the single-quotes as opposed to double-quotes?

A value of { "Content-Security-Policy" : "default-src 'self';" } passed into the $add_header parameter of nginx::resource::server will result in the configuration add_header 'Content-Security-Policy' 'default-src 'self';', which breaks the nginx syntax.

I tried using double-quotes in the CSP header as a workaround, but it breaks on certain keywords in the browser.

@wyardley
Copy link
Collaborator

wyardley commented Dec 22, 2016

@bryangwilliam can you open a new issue about this? Not sure how soon someone will have time to look at it, but at least we won't lose track of it.

You might just use the raw append / prepend options for now, but agree that we should come up with a better fix. Are there cases where having double quotes around the header value itself causes a problem?

Presumably, we should add some spec test cases for various scenarios, and then rework it until they all pass.

@bryangwilliam
Copy link
Contributor

I did find the raw_prepend option which fixed it for me in the short term, but I'd definitely be interested in a more elegant solution. I wasn't sure if this should go in as a new issue, so I'll go ahead and do that now.

@wyardley
Copy link
Collaborator

@bryangwilliam Awesome! If you're motivated to play around with it some more, happy to help you get setup in terms of writing some tests so that you can play around with submitting a PR.

slm0n87 pushed a commit to slm0n87/puppet-nginx that referenced this pull request Mar 7, 2019
Resolving issue voxpupuli#803 by adding quotes around the parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants