Skip to content
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 Expect: 100-Continue support to HTTP input #1998

Merged
merged 1 commit into from Apr 1, 2016
Merged

Conversation

@kroepke
Copy link
Member

@kroepke kroepke commented Mar 30, 2016

Previously the input blindly answered with 202 Accepted but instead it should properly support the Expect header.
Failing to respond correctly resulted in loss of messages because the client's expectation was broken.

Adding a HttpChunkAggregator fixes the issue while still allowing non-chunked requests to be sent.

fix #1939

Previously the input blindly answered with 202 Accepted but instead it should properly support the Expect header.
Failing to respond correctly resulted in loss of messages because the client's expectation was broken.

Adding a HttpChunkAggregator fixes the issue while still allowing non-chunked requests to be sent.

fix #1939
@kroepke kroepke added this to the 2.0.0 milestone Mar 30, 2016
@kroepke
Copy link
Member Author

@kroepke kroepke commented Mar 30, 2016

Sample HTTP traffic:

02:40:35 server1$ curl -XPOST -vvv -HContent-Type:application/json -HExpect:100-Continue --http1.1 http://127.0.0.1:12999/gelf -d @/tmp/gelf.json
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 12999 (#0)
> POST /gelf HTTP/1.1
> Host: 127.0.0.1:12999
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type:application/json
> Expect:100-Continue
> Content-Length: 122
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 202 Accepted
< Content-Length: 0
< Connection: keep-alive
<
* Connection #0 to host 127.0.0.1 left intact
02:40:42 server1$ curl -XPOST -vvv -HContent-Type:application/json --http1.1 http://127.0.0.1:12999/gelf -d @/tmp/gelf.json
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 12999 (#0)
> POST /gelf HTTP/1.1
> Host: 127.0.0.1:12999
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type:application/json
> Content-Length: 122
>
* upload completely sent off: 122 out of 122 bytes
< HTTP/1.1 202 Accepted
< Content-Length: 0
< Connection: keep-alive
<
* Connection #0 to host 127.0.0.1 left intact
@dennisoelkers dennisoelkers self-assigned this Mar 30, 2016
@dennisoelkers dennisoelkers merged commit 5eb3f93 into master Apr 1, 2016
4 checks passed
4 checks passed
@garybot2
ci-server-integration Jenkins build graylog2-server-integration-pr 772 has succeeded
Details
@garybot2
ci-web-linter Jenkins build graylog-pr-linter-check 261 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@dennisoelkers dennisoelkers deleted the issue-1939 branch Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants