Closed mtyaka closed 5 months ago
Hi @mtyaka,
Thank you for the report. It will be fixed.
I wander, with what webservers you have issues? Because even though the port is missing in Host header, ngx.fetch() performs a connection to the specified port.
Thank you @xeioex!
I wander, with what webservers you have issues? Because even though the port is missing in Host header, ngx.fetch() performs a connection to the specified port.
I noticed this while connecting to a custom web service that logs the value of the Host header and I noticed inconsistencies between requests made from a browser and those made with ngx.fetch
. It wasn't causing any real issues in my case, but it does deviate from the spec.
When using
ngx.fetch()
with a non-standard port, theHost
header of the request contains only the hostname without the port.The request that hits the server when using the code below contains the
Host
header with valuemyhost.com
, when it should bemyhost.com:8443
.As a workaround it's possible to manually set the
Host
header when making a fetch request: