hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Koch <johannes.k...@fit.fraunhofer.de>
Subject Re: [HttpClient] Adjusting location URIs
Date Thu, 25 Oct 2007 12:37:13 GMT
Hi Ortwin

Ortwin Gl├╝ck schrieb:
> No, we must not prepend a / as this would change the semantics. Instead
> the resulting URI must be resolved against the request URI:
> 
> Request URI = http://www.example.org/a/b/foo.html
> Location: bar.html
> 
> => http://www.example.org/a/b/bar.html
> 
> versus
> 
> Request URI = http://www.example.org/a/b/foo.html
> Location: /bar.html
> 
> => http://www.example.org/bar.html
> 
> See the URI.resolve method.

But currently with

   Location: foo.bar

the result from

   uri = new URI(
     target.getSchemeName(),
     null,
     target.getHostName(),
     target.getPort(),
     uri.getPath(),
     uri.getQuery(),
     uri.getFragment());

is a URI where the path component does not start with a '/'. And so I get

java.net.URISyntaxException: Relative path in absolute URI: 
http://www.example.orgfoo.bar

-- 
Johannes Koch
BIKA Web Compliance Center - Fraunhofer FIT
Schloss Birlinghoven, D-53757 Sankt Augustin, Germany
Phone: +49-2241-142628    Fax: +49-2241-142065

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


Mime
View raw message