If the host as determined by rule 1 or 2 is not a valid host on the server, the response MUST be a 400 (Bad Request) error message. If the Request-URI is not an absoluteURI, and the request includes a Host header field, the host is determined by the Host header field value.ģ. Any Host header field value in the request MUST be ignored.Ģ. If Request-URI is an absoluteURI, the host is part of the Request-URI. I looked up the HTTP specification, and as described in section 5.2 of the RFC:ġ. I swear I’ve done this before without a Host header though. I eliminated the User-Agent the Accept headers and it still worked, so the missing Host header was the cause of my problems. I put the same headers (with a modified User-Agent) into my printf statement: I decided to take a look at what curl was sending, since that was working: Which also returned a HTTP/1.1 400 Bad Request error. Which returned a HTTP/1.1 400 Bad Request error. On a server running Apache 2.4.6, first I tried: curl is an excellent tool for ad hoc HTTP requests. I must have had some reason for wanting to do this, although I can’t think of why right now.
0 Comments
Leave a Reply. |