hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Moore (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1392) CLONE - redirect error! java.net.URISyntaxException: Illegal character
Date Fri, 23 Aug 2013 20:19:52 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13748955#comment-13748955
] 

Jon Moore commented on HTTPCLIENT-1392:
---------------------------------------

@Saurabh: Browsers may be being "lenient in what they accept", per Postel's Law. There's actually
considerable debate as to whether this is actually good engineering advice or not. Currently,
HttpComponents aims pretty strongly for tight adherence to the RFC specs, and these indicate
that HTTP header values (including for the Location header) may only contain ASCII characters
per RFC 2616.

If you read HTTPCLIENT-1204 you will see in the comments that there is a way to override the
DefaultRedirectStrategy if you would prefer different behavior.

Oleg is reacting to the following behaviors:
(a) You reopened this issue despite it having been closed as a duplicate of another issue.
It would be customary in this case to then continue discussion there, or at least to post
a comment clarifying why you don't think this is a duplicate.
(b) The "posting rejected" email actually states that your post got rejected because you were
not a member of the list.
(c) You were advised that this issue had already been discussed on the user list and that
a little research might be appropriate, and were explicitly asked not to reopen the issue,
yet you did.

You may not have realized it, but these are all breaches of open source etiquette. The maintainers
of this project are largely volunteers; they do not owe anyone anything. Treating their time
with respect is important.

For example, I googled "httpclient illegal character in redirect" (my first search attempt):
http://lmgtfy.com/?q=httpclient+illegal+character+in+redirect

And on the first search result page, I find:
(a) HTTPCLIENT-1204, which is the duplicate issue
(b) A StackOverflow answer explaining the problem in detail.
(c) A link to a post from the httpclient-user mailing list where this issue was discussed.

You may not have realized this, but you could have found the answer to this question pretty
easily without opening an issue.

I took the time to explain this under the assumption that you just weren't familiar with these
rules of etiquette and hadn't intended to exasperate anyone. Hopefully you now have enough
information:

(a) to understand and solve your problem;
(b) to avoid a similar (probably unintended) negative reaction in the future from this or
other open source projects.

                
> CLONE - redirect error!  java.net.URISyntaxException: Illegal character 
> ------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1392
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1392
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>         Environment: centos6.2
> jdk1.6u25
>            Reporter: Saurabh
>
> ==========Test.java===================== 
>  HttpClient client = new DefaultHttpClient();
>  HttpGet get = new HttpGet("http://localhost:8080/T/Test");
>  client.execute(get);
>  client.getConnectionManager().shutdown();
> ==========TestServlet.java=============================
>  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
>         response.sendRedirect("/xx?name=||dsdf&user=||");
>     }
> ===============================================
> Throws an exception when I run.
> Exception in thread "main" org.apache.http.client.ClientProtocolException
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:909)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
> 	at com.Test.main(Test.java:20)
> Caused by: org.apache.http.ProtocolException: Invalid redirect URI: http://localhost:8080/xx?name=||dsdf&user=||
> 	at org.apache.http.impl.client.DefaultRedirectStrategy.createLocationURI(DefaultRedirectStrategy.java:189)
> 	at org.apache.http.impl.client.DefaultRedirectStrategy.getLocationURI(DefaultRedirectStrategy.java:140)
> 	at org.apache.http.impl.client.DefaultRedirectStrategy.getRedirect(DefaultRedirectStrategy.java:209)
> 	at org.apache.http.impl.client.DefaultRequestDirector.handleResponse(DefaultRequestDirector.java:1070)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:546)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
> 	... 3 more
> Caused by: java.net.URISyntaxException: Illegal character in query at index 30: http://localhost:8080/xx?name=||dsdf&user=||
> 	at java.net.URI$Parser.fail(URI.java:2810)
> 	at java.net.URI$Parser.checkChars(URI.java:2983)
> 	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
> 	at java.net.URI$Parser.parse(URI.java:3015)
> 	at java.net.URI.<init>(URI.java:577)
> 	at org.apache.http.impl.client.DefaultRedirectStrategy.createLocationURI(DefaultRedirectStrategy.java:187)
> 	... 8 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message