You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Johannes Koch (JIRA)" <ji...@apache.org> on 2009/05/04 21:20:30 UTC
[jira] Created: (HTTPCLIENT-847) Handling of a buggy response to
HEAD request
Handling of a buggy response to HEAD request
--------------------------------------------
Key: HTTPCLIENT-847
URL: https://issues.apache.org/jira/browse/HTTPCLIENT-847
Project: HttpComponents HttpClient
Issue Type: Question
Affects Versions: 4.0 Beta 2
Environment: Java 1.5.0_14
Reporter: Johannes Koch
Priority: Minor
I tried to make a HEAD request to some server and discovered, that the server seems to respond in some buggy way. The response is a 302 and contains an entity.
This makes HttpClient waiting and wainting and ... when redirecting is true.
What would be the preferred way to make HttpClient stop processing the response in this situation?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Resolved: (HTTPCLIENT-847) Handling of a buggy response to
HEAD request
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oleg Kalnichevski resolved HTTPCLIENT-847.
------------------------------------------
Resolution: Won't Fix
Johannes,
I am afraid I do not have any good news for. It is just not possible to work this issue around for non-compliant HTTP servers without breaking compatibility with compliant ones.
However, you can always override the default behavior of HttpClient for a particular application specific context:
(1) subclass HttpRequestExecutor
(2) override HttpRequestExecutor#doReceiveResponse method
(3) provide custom logic for HEAD responses either originating from servers that are known to be broken or based on the 'Server' response header or some other settings
(4) subclass DefaultHttpClient
(5) override DefaultHttpClient#createRequestExecutor method and replace the default implementation with the custom one.
Hope this helps
Oleg
> Handling of a buggy response to HEAD request
> --------------------------------------------
>
> Key: HTTPCLIENT-847
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-847
> Project: HttpComponents HttpClient
> Issue Type: Question
> Affects Versions: 4.0 Beta 2
> Environment: Java 1.5.0_14
> Reporter: Johannes Koch
> Priority: Minor
> Attachments: TestHeadRequestWithBuggyServer.java
>
>
> I tried to make a HEAD request to some server and discovered, that the server seems to respond in some buggy way. The response is a 302 and contains an entity.
> This makes HttpClient waiting and wainting and ... when redirecting is true.
> What would be the preferred way to make HttpClient stop processing the response in this situation?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Updated: (HTTPCLIENT-847) Handling of a buggy response to
HEAD request
Posted by "Johannes Koch (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johannes Koch updated HTTPCLIENT-847:
-------------------------------------
Attachment: TestHeadRequestWithBuggyServer.java
Please see attached TestCase.
>From looking at the logs it seems that the entity in the first response is processed during the processing of the redirected request.
-- LOG --
[...]
2009.05.04 21:19:27 421 DEBUG org.apache.http.headers - >> GET /menu/home/Pages/home.aspx HTTP/1.1
2009.05.04 21:19:27 421 DEBUG org.apache.http.headers - >> Host: www.cowi.dk
2009.05.04 21:19:27 421 DEBUG org.apache.http.headers - >> Connection: Keep-Alive
2009.05.04 21:19:27 421 DEBUG org.apache.http.headers - >> User-Agent: Apache-HttpClient/4.0-beta2 (java 1.5)
2009.05.04 21:19:27 421 DEBUG org.apache.http.wire - << "<head><title>Document Moved</title></head>[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "<body><h1>Object Moved</h1>This document may be found <a HREF="http://www.cowi.dk/menu/home/Pages/home.aspx">here</a></body>HTTP/1.1 200 OK[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "Connection: Keep-Alive[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "Content-Length: 36992[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "Expires: Mon, 04 May 2009 19:20:17 GMT[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "Date: Mon, 04 May 2009 19:19:23 GMT[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "Content-Type: text/html; charset=utf-8[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "Server: Microsoft-IIS/6.0[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "X-Powered-By: ASP.NET[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "X-AspNet-Version: 2.0.50727[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "Cache-Control: private[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "Vary: *[EOL]"
2009.05.04 21:19:27 687 DEBUG org.apache.http.wire - << "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[EOL]"
2009.05.04 21:19:27 703 DEBUG org.apache.http.wire - << "<html id="ctl00_Html1" __expr-val-dir="ltr" dir="ltr">[EOL]"
[...]
-- LOG --
> Handling of a buggy response to HEAD request
> --------------------------------------------
>
> Key: HTTPCLIENT-847
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-847
> Project: HttpComponents HttpClient
> Issue Type: Question
> Affects Versions: 4.0 Beta 2
> Environment: Java 1.5.0_14
> Reporter: Johannes Koch
> Priority: Minor
> Attachments: TestHeadRequestWithBuggyServer.java
>
>
> I tried to make a HEAD request to some server and discovered, that the server seems to respond in some buggy way. The response is a 302 and contains an entity.
> This makes HttpClient waiting and wainting and ... when redirecting is true.
> What would be the preferred way to make HttpClient stop processing the response in this situation?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[jira] Closed: (HTTPCLIENT-847) Handling of a buggy response to
HEAD request
Posted by "Johannes Koch (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCLIENT-847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johannes Koch closed HTTPCLIENT-847.
------------------------------------
> Handling of a buggy response to HEAD request
> --------------------------------------------
>
> Key: HTTPCLIENT-847
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-847
> Project: HttpComponents HttpClient
> Issue Type: Question
> Affects Versions: 4.0 Beta 2
> Environment: Java 1.5.0_14
> Reporter: Johannes Koch
> Priority: Minor
> Attachments: TestHeadRequestWithBuggyServer.java
>
>
> I tried to make a HEAD request to some server and discovered, that the server seems to respond in some buggy way. The response is a 302 and contains an entity.
> This makes HttpClient waiting and wainting and ... when redirecting is true.
> What would be the preferred way to make HttpClient stop processing the response in this situation?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org