It seems that when there are multiple same-named HTTP headers in a request:
public shared func test(): async Text {
let headers = Http.headersNew();
headers.put("Host", ["local.vporton.name:8081"]); // overrides the default
// Add arbitrary headers for testing:
headers.put("Content-Type", ["text/plain"]);
headers.put("X-My", ["my", "my2"]);
let res = await Call.callHttp(
{
url = "https://local.vporton.name:8443";
headers = headers.share();
body = "";
method = #get;
},
null,
{
max_response_bytes = ?10_000;
cycles = 900_000_000_000; // TODO: much too much
timeout = 60_000_000_000; // 60 sec
},
);
let ?body = Text.decodeUtf8(Blob.fromArray(res.body)) else {
Debug.trap("No response body.")
};
body;
}
(a code from currently debugged GitHub - vporton/joining-proxy-rust: This will contain a proxy that intentionally delivers outdated data), then HTTP outcall preserves only one header. That’s wrong. Multiple same-named headers is legit in HTTP and they should be preserved.
However, this may be a fake alarm, I didn’t thoroughly test it yet.