-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Header modification by k6/go: ++ Transfer-Encoding: chunked #2483
Comments
Thanks for reporting this @kkriegkxs, This seems to be go stdlib thing. As To fix it you can just put But it might be a good idea if we do the same for an empty string as well 🤔. This is reproducible with: import http from "k6/http";
export default () => {
http.post("https://httpbin.test.k6.io", "");
} The headers don't make any difference |
🤔 If you run this script with both import http from "k6/http";
export let options = {
httpDebug: 'full'
};
export default () => {
let resp = http.post("https://httpbin.org/anything", '');
console.log(resp.body);
} It seems that:
Both of these behaviors seem weird and unexpected to me... 😕 If they were exactly reversed, I'd have probably been fine in keeping them as they are and just documenting them. It makes some sense for k6 to emit |
we do set it k6/lib/netext/httpext/request.go Line 166 in ece4633
chunked encoding.
|
From https://pkg.go.dev/net/http#Request.Write
Maybe we should explicitly specify @kkriegkxs, how did you notice this issue? Were there any side-effects from |
@na-- & @mstoykov: Transfer-Encoding: identity did exactly nothing, however nulling the body fixed it (regretfully it did not occur to me to try it before...). I saw the setting of the length header but as @mstoykov said, it is not sent due to chunked. post( url, [body], [params] )
@na--: no, there was a problem in SignalR (longpoll) resulting in code 501s. It took me a while (and #2482) to figure out what was happening. So I guess it is probably a more common issue than one might think (though I don't know how k6 recorder renders JS is such case). |
Oh, btw, per Mozilla: |
Brief summary
K6 (or go http client) chunks some SignalR POST calls (with empty payload) over SSL only
k6 version
37
OS
win 10
Docker version and image (if applicable)
No response
Steps to reproduce the problem
Not sure...
Here is the sample request structure:
Expected behaviour
Works as expected on a non-SSL endpoint and on SSL endpoint via Fiddler
Actual behaviour
Occurs for a couple of SignalR POST calls over SSL only
Works fine when called over HTTP, however when switching to SSL (over reverse proxy), K6 (GO http client?) changes the headers, even when:
When passing requests through Fiddler, everything comes out as it should (Content-Length: 0 and no Transfer-Encoding).
Interestingly, the app server actually receives "Transfer-Encoding: chunked , chunked " when Transfer-Encoding: chunked is sent (reverse proxy mishandles improper chunking)
The text was updated successfully, but these errors were encountered: