Fix issue with loading page not showing in Traefik for h2 connections #173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I continued my investigation of issue #165 and I discovered that when making a working request these are the headers seen by cURL:
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 inserveDynamic
and loading pages tend to be above the threshold so I think not propagating it is the right fix for the issue.