Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Amazon authentication: Fix Expect: 100-continue #49

Closed
wants to merge 1 commit into from

Conversation

alexmuntean
Copy link

Amazon clients add in header expect:100-continue and is waiting for approval to send the body on the second line in socket.
Amazon server responds fast but FakeS3 has this problem. Why? Because the client is waiting for approval of the server...
How this Expect: 100 continue works?: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html (8.2.3)

  • Respond with 100 Ok if the client has "expect: 100-continue" in header

- Respond with 100 Ok if the client has "expect: 100-continue" in header
@alexmuntean
Copy link
Author

@ddossot created an issue ... maybe he will merge it...

@ddossot
Copy link

ddossot commented Feb 26, 2015

@alexmuntean Thank you!

@ddossot
Copy link

ddossot commented Feb 26, 2015

@btalbot Are you sure this is needed?

Looking at WebRick's source code, it seems that HTTP headers are down-cased: https://github.com/ruby/ruby/blob/trunk/lib/webrick/httprequest.rb#L288

WebRick itself relies on this this internally when it compares with expected values: https://github.com/ruby/ruby/blob/trunk/lib/webrick/httprequest.rb#L566

@btalbot
Copy link

btalbot commented Feb 26, 2015

I think that the header "name" is converted to downcase, but afaik, the header "value" is not.

https://github.com/ruby/ruby/blob/trunk/lib/webrick/httprequest.rb#L288

is the only use of downcase that I see.

@ddossot
Copy link

ddossot commented Feb 26, 2015

@btalbot You are 100% right 🙇 Pardon my stupidity 😿

@ddossot
Copy link

ddossot commented Feb 27, 2015

@jubos Are you reluctant to pull this in because of the case sensitivity? Without proper handling of continue requests, fake-s3 is almost unusable so I'd be happy re-doing the PR with the code change suggested by @btalbot if it could help moving forward.

@alexmuntean
Copy link
Author

@ddossot you can use my github repo as a gem... I won't remove the project. this PR is created a long ago and @jubos didn't say anything... I know it's needed. The company I was working for was using fake-s3 to use test the code but it was very slow (3 seconds or so for a request) and this is the PR.. I am 100% that you encountered the same thing :)

@ddossot
Copy link

ddossot commented Feb 28, 2015

@alexmuntean Thanks! I'm pulling fake-s3 from rubygems via the Torquebox Maven proxy (because I'm running it on jRuby). So I need the gem on rubygems. I've pulled your change in my fork and I think that I will just push a variation of fake-s3 on rubygems just so I can build my project.

@jubos
Copy link
Owner

jubos commented Mar 1, 2015

Alex, I plan to get this merged into the next point release. Thanks for handling the continue requests.

@ddossot
Copy link

ddossot commented Mar 1, 2015

@jubos Exciting news! 👏

@jubos
Copy link
Owner

jubos commented Mar 5, 2015

I merged this into master.

@jubos jubos closed this Mar 5, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants