Index: [Article Count Order] [Thread]

Date: Thu, 23 May 2002 21:03:40 +0900
From: GOTO Kentaro <gotoken@notwork.org>
Subject: [webricken:101] Re: Full Request URL?
To: webricken@notwork.org
Message-Id: <200205231203.g4NC3erF068438@miso.k.notwork.org>
In-Reply-To: <20020523102325.RJLC10730.mta2-rme.xtra.co.nz@there>
References: <20020522104939.GA27266@peta.cs.auc.dk>	<200205221134.g4MBYlrF065627@miso.k.notwork.org>	<20020523102325.RJLC10730.mta2-rme.xtra.co.nz@there>
X-Mail-Count: 00101

At Thu, 23 May 2002 22:20:13 +1200,
Holden Glova wrote:

> Interesting I was using req.path to get a similar value, which is preferred 
> and why?

Hmm, That depends on purpose.  req.path doesn't include query part of
the requested URI.  In case of httpproxy, request_uri also has host
part.  req.path is identical to
HTTPUtils::unescape(req.request_uri.path).

> Remember that if you want to use just the string representation of the URI 
> make sure to do a req.request_uri.to_str and do not use req.request_uri.to_s 
> because it yields a different result.

Really?  WEBrick does "require 'uri'" and URI::Generic#to_s is defined
as follows in uri/generic.rb:

    def to_s
      to_str
    end

-- Gotoken