savonrb / savon-multipart

Heavy metal Ruby SOAP client with multipart support
MIT License
17 stars 48 forks source link

Case insensitivity of multipart header regex #16

Closed stevenvegt closed 9 years ago

stevenvegt commented 9 years ago

My response header contains Content-Type:

The regex is on line 33: https://github.com/savonrb/savon-multipart/blob/master/lib/savon/multipart/response.rb#L33

I think it is to small to make a pull request, but let me know if you prefer one!

Steven

tjarratt commented 9 years ago

Hey @stevenvegt thanks for opening this issue. I was pretty happy to make this change, but then I remembered that HTTP headers are not supposed to be case sensitive.

Are you sure that's your problem? If so, you probably have a non-compliant HTTP header parser. I'm not entirely opposed to making this change, although it would be nice to add tests for it, and justify the need for it, but I'd like to ensure this is actually a real issue first.

stevenvegt commented 9 years ago

And this is how we learn something every day :)

The RFC states the header field names are supposed to be care-insensitive. Does this also count for the field values? (Couldn't find anything anything in the RFC)

I use Savon in my own gem which does not include a lot of other gems. I suppose this results in the default 'net/http' lib for parsing http headers?

gem 'savon', "~> 2"
gem 'savon-multipart'
gem 'nokogiri', "~> 1.4"

group :development do
  gem 'vcr'
  gem 'webmock'
  gem 'bundler', "~> 1.5"
  gem 'jeweler', "~> 2"
  gem 'gemfury', "~> 0"
  gem 'rspec', "~> 2"
end

I'm not apposed to using another http parser. Any suggestions for a low overhead parser to test with?

tjarratt commented 9 years ago

Oh that's a good point. I hadn't considered the values might be case sensitive. I'll have to look into this a bit more tonight.

Sent From A Very Small Keyboard

On Apr 8, 2015, at 01:09, stevenvegt notifications@github.com wrote:

And this is how we learn something every day :)

The RFC states the header field names are supposed to be care-insensitive. Does this also count for the field values? (Couldn't find anything anything in the RFC)

I use Savon in my own gem which does not include a lot of other gems. I suppose this results in the default 'net/http' lib for parsing http headers?

gem 'savon', "~> 2" gem 'savon-multipart' gem 'nokogiri', "~> 1.4"

group :development do gem 'vcr' gem 'webmock' gem 'bundler', "~> 1.5" gem 'jeweler', "~> 2" gem 'gemfury', "~> 0" gem 'rspec', "~> 2" end I'm not apposed to using another http parser. Any suggestions for a low overhead parser to test with?

— Reply to this email directly or view it on GitHub.

tjarratt commented 9 years ago

Okay, it seems like header values may be case sensitive. Will be fixing this shortly.

tjarratt commented 9 years ago

Thanks for reporting this @stevenvegt -- and thanks for using Savon!

stevenvegt commented 9 years ago

Wow, that's quick! Thanks for building this great gem! :)

tjarratt commented 9 years ago

I really can't take much credit. @rubiii did all of the work for several years, and we've had a lot of wonderful people from the community report issues and send pull requests. I just have the honor of maintaining it now and helping keep things running smoothly. :grinning: