Mailing List Archive

mod_perl 2.0.4: $r->uri
Hi All

It seems that $r->uri returns the URI string with %20 decoded to white space, but leaves "+" unchanged.
Is this the right behaviour?


Jie

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: mod_perl 2.0.4: $r->uri [ In reply to ]
On Monday, June 06, 2011 08:19:00 Jie Gao wrote:
> It seems that $r->uri returns the URI string with %20 decoded to white
> space, but leaves "+" unchanged. Is this the right behaviour?

RFC2396 defines escaped encoding as "%" hex hex only, see chapter 2.4.1.
In this sense I think the answer is yes.

Anyway, this is rather a httpd API than a modperl question. Modperl only
provides access to the "uri" field of the "struct request_rec" here. So,
for more information ask here:

dev@httpd.apache.org
users@httpd.apache.org

Torsten Förtsch

--
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: mod_perl 2.0.4: $r->uri [ In reply to ]
Thanks for your reply.

Now if I want to get a work-around within mod_perl, what would you do?


Jie Gao | Systems Administrator
Information and Communications Technology

THE UNIVERSITY OF SYDNEY
316 Abercrombie Street Building G17 | The University of Sydney | NSW | 2006

T +61 2 8627 7824 | E j.gao@sydney.edu.au | W http://sydney.edu.au/ict/

CRICOS 00026A
This email plus any attachments to it are confidential. Any unauthorised
use is strictly prohibited. If you receive this email in error, please
delete it and any attachments.

Please think of our environment and only print this e-mail if necessary.

* Torsten F?rtsch <torsten.foertsch@gmx.net> wrote:

> Date: Mon, 6 Jun 2011 10:13:42 +0200
> From: Torsten F?rtsch <torsten.foertsch@gmx.net>
> To: dev@perl.apache.org
> CC: Jie Gao <J.Gao@isu.usyd.edu.au>
> Subject: Re: mod_perl 2.0.4: $r->uri
> User-Agent: KMail/1.13.5 (Linux/2.6.34.8-0.2-desktop; KDE/4.4.4; x86_64;
> ; )
>
> On Monday, June 06, 2011 08:19:00 Jie Gao wrote:
> > It seems that $r->uri returns the URI string with %20 decoded to white
> > space, but leaves "+" unchanged. Is this the right behaviour?
>
> RFC2396 defines escaped encoding as "%" hex hex only, see chapter 2.4.1.
> In this sense I think the answer is yes.
>
> Anyway, this is rather a httpd API than a modperl question. Modperl only
> provides access to the "uri" field of the "struct request_rec" here. So,
> for more information ask here:
>
> dev@httpd.apache.org
> users@httpd.apache.org
>
> Torsten Förtsch
>
> --
> Need professional modperl support? Hire me! (http://foertsch.name)
>
> Like fantasy? http://kabatinte.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: mod_perl 2.0.4: $r->uri [ In reply to ]
On Monday, June 06, 2011 10:25:14 Jie Gao wrote:
> Now if I want to get a work-around within mod_perl, what would you do?

First, you have to define what you think is the "right" behavior. Then
you can for instance use a PerlTransHandler to patch the uri field as
required.

PerlTransHandler "sub { \
my ($r)=@_; \
$r->uri(parse_uri $r->unparsed_uri); \
-1; \
}"

parse_uri() is to be defined by you.

Torsten Förtsch

--
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org