jakarta-watchdog-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Wilkins <gr...@mortbay.com>
Subject Host header again.
Date Mon, 04 Feb 2002 04:04:33 GMT


Thanks for adding the Host header into watchdog - however there is still
a problem.

By default you are only setting

   Host: localhost

when you should be setting

   Host: localhost:8080

The RFC says:

    Host = "Host" ":" host [ ":" port ] ; Section 3.2.2

    A "host" without any trailing port information implies the default
    port for the service requested (e.g., "80" for an HTTP URL).

So even though Jetty receives the requests on port 8080, getServerPort
returns 80, as this is what the Host header indicates the client used
for their request and that some proxy or gateway did the redirection to
port 8080.

Note that there is even a difference between

   Host: localhost:80


   Host: localhost

As some browsers treat cookies set for localhost:80 as being for a different host
than just localhost.    So Jetty tries to be rigorous when rewriting URLs to always use
the exact form that was specified in the host header.



Greg Wilkins<gregw@mortbay.com>          GB  Phone: +44-(0)7092063462
Mort Bay Consulting Australia and UK.    Mbl Phone: +61-(0)4 17786631
http://www.mortbay.com                   AU  Phone: +61-(0)2 98107029

To unsubscribe, e-mail:   <mailto:watchdog-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:watchdog-dev-help@jakarta.apache.org>

View raw message