Hello Oleg,
Sorry it's not clear.
Using Httpclient, we call this jsp which ad you can see does a redirection
with unsafz characters in url, redirection fails with the mentionned
exception.
This is due to the way hc4 impl builds a Uri from it not checking for
unsafe characters.

my question is , is this fine or not ?

Thanks
Regards
Philippe
On Wednesday, August 7, 2013, Oleg Kalnichevski wrote:

> On Tue, 2013-08-06 at 22:58 +0200, Philippe Mouawad wrote:
> > Hello,
> >
> > We have an issue with redirection handling in HttpClient 4.2.5
> > We have a JSP that contains the following code:
> >
> > <%@ page session="false"  contentType="text/html"  buffer="8kb" %>
> > <html>
> > <body>
> >
> > <%
> > response.sendRedirect("http://localhost:8080/?[]!@#$%^&*()");
> > %>
> >
> > </body>
> > </html>
> >
> >
> > As you can see it contains unsafe characters.
> >
> > It fails with:
> > Caused by: org.apache.http.ProtocolException: Invalid redirect URI:
> > http://localhost:8080/?[]!@#$%^&*()
> >     at
> >
> org.apache.http.impl.client.DefaultRedirectStrategy.createLocationURI(DefaultRedirectStrategy.java:197)
> >     at
> >
> org.apache.http.impl.client.DefaultRedirectStrategy.getLocationURI(DefaultRedirectStrategy.java:148)
> >     at
> >
> org.apache.http.impl.client.DefaultRedirectStrategy.getRedirect(DefaultRedirectStrategy.java:217)
> >     at
> >
> org.apache.http.impl.client.DefaultRequestDirector.handleResponse(DefaultRequestDirector.java:1105)
> >     at
> >
> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:548)
> >     at
> >
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
> >     ... 9 more
> > Caused by: java.net.URISyntaxException: Malformed escape pair at index
> 29:
> > http://localhost:8080/?[]!@#$%^&*()
> >     at java.net.URI$Parser.fail(URI.java:2810)
> >     at java.net.URI$Parser.scanEscape(URI.java:2940)
> >     at java.net.URI$Parser.scan(URI.java:2963)
> >     at java.net.URI$Parser.checkChars(URI.java:2981)
> >     at java.net.URI$Parser.parse(URI.java:3029)
> >     at java.net.URI.<init>(URI.java:577)
> >     at
> >
> org.apache.http.impl.client.DefaultRedirectStrategy.createLocationURI(DefaultRedirectStrategy.java:195)
> >     ... 14 more
> >
> > It succeeds with Java Implementation.
> >
>
> Philippe,
>
> I am not sure I understand your question (if it is a question).
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> httpclient-users-unsubscr...@hc.apache.org<javascript:;>
> For additional commands, e-mail: 
> httpclient-users-h...@hc.apache.org<javascript:;>
>
>

-- 
Cordialement.
Philippe Mouawad.

Reply via email to