let request_headers = [
{ name = "Host"; value = host # ":443" },
{ name = "User-Agent"; value = "icp_google_agent" },
{ name = "Content-Type"; value = "application/json" },
{ name = "Idempotency-Key"; value = idempotency_key },
{ name = "accept"; value = "text/plain" },
{
name = apiEndpointSettings.api_key;
value = apiEndpointSettings.api_key_value;
}
];
There was a recent change in the HTTPS Outcall feature to support HTTP/2.
We didn’t anticipate this to be a breaking change, but it turned out that HTTP/2 doesn’t support setting the Host header in the request.
Please try to remove the following line, then the outcall should work again.
let request_headers = [
{ name = "authority"; value = host},
{ name = "path"; value = resource},
{ name = "scheme"; value = "https" },
{ name = "User-Agent"; value = "agent007" },
{ name = "Content-Type"; value = "application/json" },
{ name = "Idempotency-Key"; value = idempotency_key },
{ name = "accept"; value = "text/plain" },
{
name = settings.api_key;
value = settings.api_key_value;
},
];