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 issue with loading page not showing in Traefik for h2 connections #173

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

patcher-ms
Copy link
Contributor

I continued my investigation of issue #165 and I discovered that when making a working request these are the headers seen by cURL:

curl -v http://localhost:8080/dynamic/whoami
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /dynamic/whoami HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Type: text/html
< Date: Sun, 27 Aug 2023 00:23:52 GMT
< Transfer-Encoding: chunked
< 

Note that Content-Length is not present. https://stackoverflow.com/questions/75091383/why-does-golang-http-responsewriter-auto-add-content-length-if-its-no-more-than talks about this and describes what's going on.

Apparently this is not an issue for HTTP/1.1 connections, which are used by cURL and the browsers when there is no TLS involved.
When the request is HTTPs cURL and browsers prefer to use h2, which I guess handle headers in a different ways.

If I force cURL to use HTTP1.1 I get the loading page even for TLS requests, so this is definitely and issue related to h2.
Anyway, Content-Length is never explicitly set in serveDynamic and loading pages tend to be above the threshold so I think not propagating it is the right fix for the issue.

@patcher-ms
Copy link
Contributor Author

@acouvreur do you have any thoughts on this?

Sorry for the ping, earlier you replied to my other issue and I wanted to make sure this PR didn’t fall through the cracks :)

@acouvreur
Copy link
Owner

Will check if any side effect might occur without sending the content length

But I might merge it soon :)

@acouvreur acouvreur merged commit 0f7e552 into acouvreur:beta Sep 13, 2023
10 of 13 checks passed
@acouvreur
Copy link
Owner

🎉 This PR is included in version 1.4.0-beta.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@acouvreur
Copy link
Owner

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Repository owner deleted a comment from allcontributors bot Sep 14, 2023
@acouvreur
Copy link
Owner

@all-contributors please add @patcher-ms for bug and code

@allcontributors
Copy link

@acouvreur

@patcher-ms already contributed before to bug, code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants