-
Notifications
You must be signed in to change notification settings - Fork 2k
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
decompress response body from websocket error #6650
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch - thanks!
// ensure the error is what we expect | ||
_, err := a.Exec(context.Background(), alloc, "bar", false, []string{"command"}, os.Stdin, os.Stdout, os.Stderr, sizeCh, nil) | ||
require.Contains(t, err.Error(), "Unexpected response code: 301") | ||
require.Contains(t, err.Error(), "Moved Permanently") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not your change but I find it very sad that we return redirect to /ui
if an /v1/
endpoint isn't found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is so strange. Filed an issue: #6656
If a websocket connection errors we currently return the error with a copy of the response body. The response body from the websocket can often times be completely illegible so remove it from the error string. make alloc id empty for more reliable failure un-gzip if content encoding header present
369a0ef
to
7864705
Compare
7864705
to
69751a7
Compare
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
If a websocket connection errors we currently return the error with a
copy of the response body. The response body from the websocket can
often times be gzipped, so check if the content-encoding was gzipped
and decompress.
Example error responses that were getting appended:
which was the result of the following response body
fixes #6545