httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Post <>
Subject ap_get_server_port
Date Tue, 15 May 2001 10:10:11 GMT
Dear Sirs,

  In 2.0.16 (as in 1.3.X) it seems that ap_get_server_port, when
  UseCanonicalName is off, returns the local port the connection is bound to.

  I feel that httpd should pick up the port from the Host header, if one is
  present.  The documentation of UseCanonicalName, as I read it, indicates this

  It is very straightforward to see the behavior I speak of:
    (1) generic 2.0.16 build
    (2) set UseCanonicalName to Off
    (3) send httpd:

      GET /manual HTTP/1.1
      Host: bogus:6666

    (4) see the response redirecting us to bogus:<listen port>, instead of

  The HTTP/1.1 spec includes the following sentences:

    An HTTP/1.1 proxy MUST ensure that any request message it forwards does
    contain an appropriate Host header field that identifies the service being
    requested by the proxy.

    For 3xx responses, the location SHOULD indicate the server's preferred URI
    for automatic redirection to the resource.

  which I would interpret as allowing either behavior.

  The current behavior seems like a bug to me.  For instance, a client
  contacting httpd (listening on port 80) via an SSH tunnel might generate the

    GET /manual HTTP/1.1
    Host: localhost:12777

  only to get redirected to


  which points to a different server.  It seems to me that making
  UseCanonicalName match its documentation would fix this problem without
  causing others.

  Is there something I am missing?

  Thanks for all the hard work.  Overall, I've been very happy with httpd, and
  I'm excited about the direction you folks are taking it.

      Alan Post

View raw message