axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ias" <iasan...@tmax.co.kr>
Subject AxisServlet's using deprecated HttpUtils.getRequestURL
Date Thu, 20 Nov 2003 10:09:21 GMT
Let me introduce the following clause:

                // NOTE:  HttpUtils.getRequestURL has been deprecated.
                // This line SHOULD be:
                //    String url = req.getRequestURL().toString()
                // HOWEVER!!!!  DON'T REPLACE IT!  There's a bug in
                // req.getRequestURL that is not in HttpUtils.getRequestURL
                // req.getRequestURL returns "localhost" in the remote
                // scenario rather than the actual host name.
                //
                // ? Still true?  For which JVM's?
                String url = HttpUtils.getRequestURL(request).toString();

One of my colleague researchers assured me that the server name is decided
by "Host" header of HTTP protocol (HTTP 1.1 requires that). For example,
Tomcat's implementation is

(org.apache.coyote.Request)
    /** 
     * Return the buffer holding the server name, if
     * any. Use isNull() to check if there is no value
     * set.
     * This is the "virtual host", derived from the
     * Host: header.
     */
    public MessageBytes serverName() {
	return serverNameMB;
    }

Moreover, Tomcat's HttpUtils.getRequestURL(request) also finally uses the
above method, so it is clear that you get "localhost" in case your client
sends "Host: localhost" header even though the actual server name is not
"localhost".

I think this explanation is sufficient for rationale of updating
HttpUtils.getRequestURL(request) to req.getRequestURL(). In addition, WS-I
Basic Profile 1.0 also strongly recommends using HTTP 1.1, so the update
can increase users' understanding of how AxisServlet works in terms of host
name.

Thanks for your opinion and feedback in advance,

Ias

===========================================================
Lee, Changshin (Korean name)
Ias (International name)
               Company Web Site: http://www.tmax.co.kr
               Personal Web Site: http://www.iasandcb.pe.kr
---------------------------------------------------------
Senior Researcher, Emerging Technology Evangelist & JCP Activities
Coordinator
JCP member - http://jcp.org/en/participation/members/L
R&D Institute
Tmax Soft, Inc. 
JCP member - http://jcp.org/en/participation/members/T
==========================================================


Mime
View raw message