hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: New issue about redirections
Date Thu, 11 Nov 2004 11:56:03 GMT
José,

HTTP spec defines US-ASCII as the only valid charset for HTTP status
line and headers. That's the reason why all HTTP URLs must be
URL-encoded. The redirect location URL you are getting is not URL
encoded and therefore is in violation of the HTTP spec. 

HttpClient 3.0 can be configured to be quite lenient about HTTP spec
compliance. One can override the default element charset by setting the
'http.protocol.element-charset' parameters to any any charset supported
by the JRE.

See HttpClient 3.0 preferences architecture guide for details

http://jakarta.apache.org/commons/httpclient/3.0/preference-api.html#HTTP%20method%20parameters
 

Hope this helps

Oleg


On Thu, Nov 11, 2004 at 09:23:14AM -0200, Jos? Vilson de Mello de Farias wrote:
> Greetings,
> 
>   I have a new question about redirections. At this time is about
> character encoding used by Httpclient to retrieve information about
> redirections from headers.
> 
> I have a redirection to files/especial_chat_here_?_doesnt_work.rar,
> but it's not working, instead of "special" characters I'm always
> getting char 0xFFFD for  all chars like ? ? ? ? etc.
> 
> Invalid chars are coming from the headers and Java shows them as '?'.
> What can I do to fix this problem and get redirections with proper
> characters?
> 
> Please check the following trace ...
> 
> 08:51:57,950 DEBUG HttpParser:73 - enter HttpParser.readRawLine()
> 08:51:57,950 DEBUG header:71 - << "Date: Thu, 11 Nov 2004 10:51:37 GMT[\r][\n]"
> 08:51:57,950 DEBUG header:71 - << "Server: Apache/1.3.31 (Unix)
> mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.9
> FrontPage/5.0.2.2634a mod_ssl/2.8.19 OpenSSL/0.9.7a[\r][\n]"
> 08:51:57,950 DEBUG header:71 - << "X-Powered-By: PHP/4.3.9[\r][\n]"
> 08:51:57,950 DEBUG header:71 - << "Expires: Thu, 19 Nov 1981 08:52:00
> GMT[\r][\n]"
> 08:51:57,960 DEBUG header:71 - << "Cache-Control: no-store, no-cache,
> must-revalidate, post-check=0, pre-check=0[\r][\n]"
> 08:51:57,960 DEBUG header:71 - << "Pragma: no-cache[\r][\n]"
> 08:51:57,960 DEBUG header:71 - << "Location:
> files/especial_chat_here_?_doesnt_work.rar[\r][\n]"
> 08:51:57,960 DEBUG header:71 - << "Transfer-Encoding: chunked[\r][\n]"
> 08:51:57,960 DEBUG header:71 - << "Content-Type: text/html[\r][\n]"
> 08:51:57,960 DEBUG HttpMethodBase:1799 - enter
> HttpMethodBase.processResponseHeaders(HttpState, HttpConnection)
> 
> Thanks in advance for all help.
> 
> Best regards,
> 
> -- 
> Jos? Vilson de Mello de Farias 
> Analista de Sistemas - APC
> 
> D?GITRO TECNOLOGIA
> E-mail: vilson.farias@digitro.com.br / vilson.farias@gmail.com
> Fone: (0xx48) 281-7158 / 9121-2432
> Fax: (0xx48) 281-7000
> Site: www.digitro.com.br / vilsonfarias.trix.net
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 

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


Mime
View raw message