Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
38
rated 0 times [  40] [ 2]  / answers: 1 / hits: 18104  / 7 Years ago, fri, april 7, 2017, 12:00:00

I have a reverse proxy server, which redirects you to different services depending on the Host header.
However when making requests to this server using a browser, the Host is always set to the domain name in the URL. I tried:



fetch(http://foo.com, {headers:{Host:bar.foo.com}})


But it doesn't work


More From » fetch-api

 Answers
92

Host is one of the forbidden header names:




A forbidden header name is an HTTP header name that cannot be modified programmatically.



[#58229] Wednesday, April 5, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
loganl

Total Points: 424
Total Questions: 86
Total Answers: 112

Location: Zimbabwe
Member since Thu, Jul 21, 2022
2 Years ago
;