-
-
Notifications
You must be signed in to change notification settings - Fork 881
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
Conversation
There was a problem hiding this 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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 -%> |
There was a problem hiding this comment.
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!
Add http_raw_prepend and http_raw_append parameters
No description provided.