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

Add http_raw_prepend and http_raw_append parameters #1093

Merged
merged 1 commit into from
Jul 11, 2017

Conversation

walkamongus
Copy link

No description provided.

Copy link
Collaborator

@wyardley wyardley left a comment

Choose a reason for hiding this comment

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

Overall, this looks good to me, thanks for squashing commits, adding tests, and reformatting in terms of spacing.

One quick question in the inline comments, but overall, I think this looks sensible.

Optional[Variant[Hash, Array]] $http_cfg_prepend = undef,
Optional[Variant[Hash, Array]] $http_cfg_append = undef,
Optional[Variant[Array[String], String]] $http_raw_prepend = undef,
Optional[Variant[Array[String], String]] $http_raw_append = undef,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, in the templates, it seems like this is only putting it in if it's an array, so is the string type needed too? I see that this is how it's implemented in the server resource, just want to make sure this is done for a reason. Or am I misunderstanding how types work?

Just from a quick read, it seems like this would allow it to be defined as a string, but then not add anything in the resulting config?

Copy link
Author

Choose a reason for hiding this comment

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

Hi @wyardley -- thanks for the comments! If a String is passed in, the template will cast it into an Array with one member e.g.

[1] pry(main)> v = 'String'
=> "String"
[2] pry(main)> Array(v)
=> ["String"]

I just used the added flexibility that was already at

<% if @raw_prepend && Array(@raw_prepend).size > 0 -%>

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it, that makes sense, didn't realize it would do that!

@wyardley wyardley merged commit 1c5dd78 into voxpupuli:master Jul 11, 2017
@alexjfisher alexjfisher added the enhancement New feature or request label Aug 1, 2017
Rubueno pushed a commit to Rubueno/puppet-nginx that referenced this pull request Oct 19, 2020
Add http_raw_prepend and http_raw_append parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants