mkim123 mkim123 - 1 month ago 8
HTTP Question

Why does telnet think I am requesting a page with an extra forward slash inserted at front?

I am trying to make a simple forwarding proxy.
It works for most websites but does not work for others.
One website that fails is
When I open this website with firefox which uses my proxy, I get a 404 Not Found response. Displayed on the page is the following message "The requested page "/" could not be found." Why is there an extra forward slash inserted at the start?

Then I try "telnet 80" with
and I get the same 404 Not Found response with the same headers and body (including the extra forward slash inserted).

Why is there an extra forward slash being inserted at the start of the url?
I am almost certain that I am requesting the page WITHOUT the forward slash inserted to the front.

Answer Source

In HTTP/1.0, you can't use absolute URLs in the request line (just insert the full path).