Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 89344 invoked from network); 20 Nov 2003 13:09:43 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 20 Nov 2003 13:09:43 -0000 Received: (qmail 38735 invoked by uid 500); 20 Nov 2003 13:09:37 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 38681 invoked by uid 500); 20 Nov 2003 13:09:37 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 38670 invoked from network); 20 Nov 2003 13:09:37 -0000 Message-ID: <20031120130938.1478.qmail@web12822.mail.yahoo.com> Date: Thu, 20 Nov 2003 05:09:38 -0800 (PST) From: Davanum Srinivas Reply-To: dims@yahoo.com Subject: Re: AxisServlet's using deprecated HttpUtils.getRequestURL To: axis-dev@ws.apache.org In-Reply-To: <200311201008.hAKA8ZI21910@kiku.7777.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N +1 to remove it. It's not too difficult to put it back in if needed. -- dims --- Ias wrote: > 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 > ========================================================== > ===== Davanum Srinivas - http://webservices.apache.org/~dims/