skipping normalize_header

22 views
Skip to first unread message

Stephen Schor

unread,
Jan 16, 2018, 11:27:29 PM1/16/18
to http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API
Hi.

I'm maintaining an app which consumes an 3rd party API that uses a non-standard header named api_key.
A call to  HTTP.headers({foo: 'bar', api_key: 'somethingsecret'})returns:

#<HTTP::Client:0x00007f8b3e0db2b0
 @connection=nil,
 @default_options=
  #<HTTP::Options:0x00007f8b3e0e0580
   @cookies={},
   @encoding=nil,
   @features={},
   @headers=#<HTTP::Headers {"Foo"=>"bar", "Api-Key"=>"somethingsecret"}>,
   @keep_alive_timeout=5,
   @nodelay=false,
   ...SNIP


I did some cursory looking in the code and didn't see a way to skip normalize_headers.
I'm just looking for some confirmation that there's no way to use the header verbatim.

Thanks for your time!
Stephen

Tony Arcieri

unread,
Jan 17, 2018, 12:30:40 AM1/17/18
to Stephen Schor, http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API
Check out #337, which is (sadly) still an open issue:


Perhaps we should add an option to disable normalization
--
Tony Arcieri

Stephen Schor

unread,
Jan 17, 2018, 12:02:56 PM1/17/18
to Tony Arcieri, http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API
Hey Tony.

Sorry for not seeing that in the issues myself.
Thanks for the fast reply.

Looks like a really good conversation about the API and implementation happening in 337.

Thanks for your work on http - it's a great library,
Stephen
Reply all
Reply to author
Forward
0 new messages