On Tue, Aug 14, 2001 at 10:20:26PM -0400, Keith Wannamaker wrote:
> Hi David,
> 
> Unfortunately there are people who were breaking because
> we didn't follow the spec.  The better way to fix it is
> to create an inverse function for 
> ap_parse_uri(request_rec *r, const char *uri) [http_protocol.c]
> in mod_jk... one that would 'unparse' the munged
> r->uri rewrite and use it instead of r->unparsed_uri.

You *could* just call ap_escape_uri and try to recreate the relevant
pieces.  Rough pseudocode:

t1 = ap_escape_uri(r->uri)
t2 = ap_escape_uri(r->args)
mod_jk's->uri = strcat(r->uri, "?", r->args, NULL)

The root problem is that r->unparsed_uri and r->uri may not be 
identical in their context.  If you are using mod_rewrite, you could 
have:

r->unparsed_uri="/foo.jsp?bar=baz"
r->uri="/spaz.jsp"
r->args="bar=baz"

But, now you may have escaped something that wasn't originally escaped.
That may be bad as well.  -- justin

Reply via email to