-
Notifications
You must be signed in to change notification settings - Fork 26
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
Replay process can not tee some request with error "Can not parse request" #71
Comments
I released new version, pls check it https://github.com/buger/gor/releases/tag/0.7.5 |
The problem is still there, but the error is different. |
For some request, I remove "Expect: 100-continue" from http header, and it works. So I guess perhaps Go's http library does not support "Expect: 100-continue". Is that a bug? |
I believe what you are seeing here is the tail end of a post that has already had most of the request sent. Basically the listener thinks the message is complete and sends it to the replay, then the listener gets more packets from the message which has already been shipped and then forwards that message to the replay. |
There were some changes in recent v0.8.4 which may help |
This is my first time posting here and I just want to congratulate you on this excellent piece of software. Its been working great for us. This is the first issue we've experienced with it so far. I've still observed this issue in the 0.8.4 release. I run gor as follows : sudo gor --input-raw :8080 --output-http xxx:8080 --output-http-method POST The replay breaks on the following conversation.
The following errors are outputted by gor.
The 'Expect: 100-Continue' header is used by clients to give the server a chance to reject the request before the client goes to the trouble of sending the request body. It's normally used when the request body is large. The client sends the request headers including 'Expect: 100-Continue'. If it gets a 'HTTP/1.1 100 Continue' back it knows it's then good to send on the request body. http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3 It looks as though gor's request parsing does not understand this header. For the first part of the conversation it expects to find a request body. It doesn't find anything so outputs the error 'unexpected EOF'. For the second part of the conversation it expects a HTTP version header, but instead finds a request body. |
It looks like output_http just delegates the request parsing to http://golang.org/pkg/net/http/#ReadRequest which does not have any special handling of this header. |
Yeah, its pretty simple parser right now... |
OK. Thanks. I see there is another issue for this #77 where you mention that handling this isn't so straightforward. I didn't see this earlier. |
@stephencurran @TigerMee well, it took a while, but now it should fixed by #158 |
In my case, I use gor(0.7.0) like:
sudo gor --input-raw :80 --output-http xxxx:80
However, about 20% request can not be transferred. The error is "Can not parse request". I want to figure out why this happens. One of the error log is:
2014/01/16 10:15:29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