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

(PUP-1885) Stringify ignores for file serving #2419

Conversation

zaphod42
Copy link
Contributor

@zaphod42 zaphod42 commented Mar 7, 2014

Commit 6353ebb introduced non-yaml
encoding for arrays of HTTP parameters. Unfortunately this also exposed
those values to the type conversion that is done to parameters in the HTTP
layer, which caused an ignore for a file matching "0" to be turned into
the number 0. The file serving code didn't handle getting non-string
ignore patterns and would then raise an error.

This changes the file server to stringify all of the parameters that it
recieves for ignores, which solves both the number problem as well as a
related one for booleans.

An alternative solution to this would have been to change the HTTP handler
so that it didn't try to convert arrays of values. I didn't go for that
because it would have caused the parameter handling to be inconsistent.

Commit 6353ebb introduced non-yaml
encoding for arrays of HTTP parameters. Unfortunately this also exposed
those values to the type conversion that is done to parameters in the
HTTP layer, which caused an ignore for a file matching "0" to be turned
into the number 0. The file serving code didn't handle getting
non-string ignore patterns and would then raise an error.

This changes the file server to stringify all of the parameters that it
recieves for ignores, which solves both the number problem as well as a
related one for booleans.

An alternative solution to this would have been to change the HTTP
handler so that it didn't try to convert arrays of values. I didn't go
for that because it would have caused the parameter handling to be
inconsistent.
This duplication actually bit me when writing the test for PUP-1885.
@puppetcla
Copy link

CLA signed by all contributors.

kylog pushed a commit that referenced this pull request Mar 8, 2014
…ith-non-string-ignores

(PUP-1885) Stringify ignores for file serving
@kylog kylog merged commit a14d1e8 into puppetlabs:master Mar 8, 2014
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.

3 participants