-
-
Notifications
You must be signed in to change notification settings - Fork 8
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 a /network/http
route
#115
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.
Submitted some comments. Looks good!
c629825
to
8e5eb70
Compare
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.
Some of the SSL form options either need params[:ssl]&.dig(...)
or we could assign ssl_params = params.fetch(:ssl,{})
in the route and use ssl_params[...]
in the form.
Headers = Types::Hash.constructor do |input, type| | ||
if input.is_a?(String) | ||
input.split(',').each_with_object({}) do |header, memory| | ||
key, value = header.split(':', 2) |
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.
Hmm, I may have merged a little too quickly. I think this code is slightly incorrect. It should parse the String by each line, then split the line by /:\s*/
, then possibly check if the value part contains ,
to split the value by ,
.
We also probably want to support repeated multiple headers:
X-Foo: value1
X-Foo: value2
X-Bar: value3
{"X-Foo"=>["value1","value2"], "X-Bar"=>"value3"}
#94