Skip to content
Snippets Groups Projects
Unverified Commit 13fde589 authored by Timo Furrer's avatar Timo Furrer
Browse files

Fix double flush for proxied 1xx responses to avoid duplicate responses

We've faced some timeout issues on proxied Kube API calls that upgraded
to SPDY.

See
https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/issues/371+

Turns out that this was due to a regression in the Golang standard
library introduced with https://go-review.googlesource.com/c/go/+/269997

tl;dr: the standard library flushes the connection on a `WriteHeader()`
for a status code of 1xx - possibly because of `100 Continue` which
needs to persist headers and with that doesn't set the internal
`wroteHeader` flag which is used to determine if it should flush or
not. However, for a `101 Switching Protocol` we actually want it to
flush (manually or not), but don't persist headers - at least don't send
the response twice.

Closes: #371
parent 5b6140cb
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment