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

fix: HttpRequestLoggerServer should not keep the connection open #158

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

iwasakims
Copy link
Contributor

What this PR changes/adds

Make HttpRequestLoggerServer return Content-length: 0 instead of Transfer-encoding: chunked.

$ curl -i -X POST --data baz localhost:4000/foo/bar
HTTP/1.1 200 OK
Date: Mon, 20 Nov 2023 08:08:10 GMT
Transfer-encoding: chunked

(curl keeps waiting for response body from server)

after:

$ curl -i -X POST --data baz localhost:4000/foo/bar
HTTP/1.1 200 OK
Date: Mon, 20 Nov 2023 09:38:23 GMT
Content-length: 0

Why it does that

Setting 0 to responseLength of HttpExchange#sendResponseHeaders means chunked transfer for sending response. Clients wait for the response body until the stream os response body is closed in the server.

Linked Issue(s)

Closes #157

@ndr-brt ndr-brt added the enhancement New feature or request label Nov 20, 2023
@ndr-brt ndr-brt merged commit e6a42dc into eclipse-edc:main Nov 20, 2023
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HttpRequestLoggerServer does not close connection
2 participants