RE: getting the hostname from a TransHandler

2000-05-17 Thread Doug MacEachern

On Wed, 17 May 2000, Geoffrey Young wrote:
 
> after reading about it again, it looks like something of a misnomer - like
> it does less parsing of the header and more making it available for
> manipulation.  but I was able to change $r->uri during PostReadRequest
> anyway.  it does make sense that all the headers must be read and available
> before translation I think, and this is what I've seen in practice...
> 
> anyway, at this point I default to those who were around earlier and
> understand where the HeaderParser phase gets its name/roots...  :)

yeah, the name is a little misleading.  it's original intent was to allow
modules to take action based on the already parsed headers early on in
the request.  which PostReadRequest can also do (and was introduced long
after HeaderParser), but is per-server, whereas HeaderParser is
per-{location,file,directory,etc}




RE: getting the hostname from a TransHandler

2000-05-17 Thread Geoffrey Young



> -Original Message-
> From: Roger Espel Llima [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 17, 2000 3:22 PM
> To: Geoffrey Young
> Cc: [EMAIL PROTECTED]
> Subject: Re: getting the hostname from a TransHandler
> 
> 
> On Wed, May 17, 2000 at 03:15:01PM -0400, Geoffrey Young wrote:
> > I don't think so - request-header parsing happens prior to the
> > PostReadRequest phase.  
> > all headers_in are available to you by uri translation.
> 
> hmm.. the eagle book seems to say the opposite. anyway, it works :) 

oh, I see what you mean - the header parser phase...

after reading about it again, it looks like something of a misnomer - like
it does less parsing of the header and more making it available for
manipulation.  but I was able to change $r->uri during PostReadRequest
anyway.  it does make sense that all the headers must be read and available
before translation I think, and this is what I've seen in practice...

anyway, at this point I default to those who were around earlier and
understand where the HeaderParser phase gets its name/roots...  :)

--Geoff

> 
> -- 
> Roger Espel Llima, [EMAIL PROTECTED]
> http://www.iagora.com/~espel/index.html
> 



RE: getting the hostname from a TransHandler

2000-05-17 Thread Karyn Ulriksen

This works for me and I use it widely:

UseCanonicalName off

and my $server  = $r->header_in('Host');

-
Best regards,

Karyn Ulriksen
Chief Systems Architect
PublicHost
22 Mauchly, Suite 200
Irvine, California  92618 USA
Phone: (949) 743-2000
email: [EMAIL PROTECTED]
URL:  http://www.publichost.com



-Original Message-
From: Geoffrey Young [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 17, 2000 12:15 PM
To: 'Roger Espel Llima'; [EMAIL PROTECTED]
Subject: RE: getting the hostname from a TransHandler




> -Original Message-
> From: Roger Espel Llima [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 17, 2000 2:52 PM
> To: [EMAIL PROTECTED]
> Subject: getting the hostname from a TransHandler
> 
> 
> Hi, 
> 
> I need to get the "Host:" header sent by the client, from a
> TransHandler.  Should I be using $r->header_in("Host"), or 
> should I turn
> UseCanonicalName off and then use $r->get_server_name?  
> 
> I'd rather do the first, and it works when I try it, but I'm also
> thinking that PerlTransHandlers run before full header parsing, 

I don't think so - request-header parsing happens prior to the
PostReadRequest phase.  
all headers_in are available to you by uri translation.

HTH

--Geoff

> so
> $r->header_in might not be recommended at that point... any clues?
> 
> -- 
> Roger Espel Llima, [EMAIL PROTECTED]
> http://www.iagora.com/~espel/index.html
> 



Re: getting the hostname from a TransHandler

2000-05-17 Thread Roger Espel Llima

On Wed, May 17, 2000 at 03:15:01PM -0400, Geoffrey Young wrote:
> I don't think so - request-header parsing happens prior to the
> PostReadRequest phase.  
> all headers_in are available to you by uri translation.

hmm.. the eagle book seems to say the opposite. anyway, it works :) 

-- 
Roger Espel Llima, [EMAIL PROTECTED]
http://www.iagora.com/~espel/index.html



RE: getting the hostname from a TransHandler

2000-05-17 Thread Geoffrey Young



> -Original Message-
> From: Roger Espel Llima [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 17, 2000 2:52 PM
> To: [EMAIL PROTECTED]
> Subject: getting the hostname from a TransHandler
> 
> 
> Hi, 
> 
> I need to get the "Host:" header sent by the client, from a
> TransHandler.  Should I be using $r->header_in("Host"), or 
> should I turn
> UseCanonicalName off and then use $r->get_server_name?  
> 
> I'd rather do the first, and it works when I try it, but I'm also
> thinking that PerlTransHandlers run before full header parsing, 

I don't think so - request-header parsing happens prior to the
PostReadRequest phase.  
all headers_in are available to you by uri translation.

HTH

--Geoff

> so
> $r->header_in might not be recommended at that point... any clues?
> 
> -- 
> Roger Espel Llima, [EMAIL PROTECTED]
> http://www.iagora.com/~espel/index.html
> 



getting the hostname from a TransHandler

2000-05-17 Thread Roger Espel Llima

Hi, 

I need to get the "Host:" header sent by the client, from a
TransHandler.  Should I be using $r->header_in("Host"), or should I turn
UseCanonicalName off and then use $r->get_server_name?  

I'd rather do the first, and it works when I try it, but I'm also
thinking that PerlTransHandlers run before full header parsing, so
$r->header_in might not be recommended at that point... any clues?

-- 
Roger Espel Llima, [EMAIL PROTECTED]
http://www.iagora.com/~espel/index.html