Redirection upon a POST

Dawit A. adawit at kde.org
Thu Jan 27 00:47:03 GMT 2005


The current behavior was done to support old broken servers, mostly HTTP/1.0 
compliant ones. However, since most producation servers today are HTTP/1.1 
compliant, maybe it is time to update how we deal with the different types of 
redirections. You can find more information about this problem in the code 
comment in kio_http.cc. Simply search for "302". 

The actual problem AFAIC is that redirection requests are never propagated 
back to the application. Instead they are automatically handled by code in 
KIO::Job. This prevents the application from deciding how to deal with the 
redirection request. That is how it should be handled. See RFC 2616 sections 
10.3, specially 10.3.3


On Tuesday 25 January 2005 16:36, David Faure wrote:
> http://www.gandi.net/whois?l=en doesn't work in konqueror: if you type
> kde.org and hit Enter, the same page appears again, instead of showing the
> "please copy this security code" text.
>
> Using the URL http://www.gandi.net/whois?l=en&domain=kde.org does the job
> just fine.
>
> The problem is that the HTTP POST leads to a redirection (Location:
> header), which makes khtml reload "http://www.gandi.net/whois?l=en", losing
> the initial HTML result which came with the POST response.
> Why doesn't Mozilla follow the redirection? Hmm, more precisely, why does
> it appear to follow it (the location bar doesn't show whois.html.en)
> without reloading the new url?
>
> kio_http: (559) POST /whois.html.en HTTP/1.1
> kio_http: (559) Connection: Keep-Alive
> kio_http: (559) User-Agent: Mozilla/5.0 (compatible; Konqueror/3.3; Linux)
> KHTML/3.3.91 (like Gecko) kio_http: (559) Referer:
> http://www.gandi.net/whois?l=en
> kio_http: (559) Pragma: no-cache
> kio_http: (559) Cache-control: no-cache
> kio_http: (559) Accept: text/html, image/jpeg, image/png, text/*, image/*,
> */* kio_http: (559) Accept-Encoding: x-gzip, x-deflate, gzip, deflate
> kio_http: (559) Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5
> kio_http: (559) Accept-Language: en
> kio_http: (559) Host: www.gandi.net
> kio_http: (559) Content-Type: application/x-www-form-urlencoded
> kio_http: (559) ============ Received Response:
> kio_http: (559) "HTTP/1.1 302 Found"
> kio_http: (559) "Date: Tue, 25 Jan 2005 21:31:18 GMT"
> kio_http: (559) "Server: Apache"
> kio_http: (559) "Location: http://www.gandi.net/whois?l=en"
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> kio_http: (559) "Keep-Alive: timeout=15, max=100"
> kio_http: (559) "Connection: Keep-Alive"
> kio_http: (559) "Transfer-Encoding: chunked"
> kio_http: (559) "Content-Type: text/html; charset=iso-8859-1"
> kio_http: (559) --empty--

-- 
Regards,
Dawit A.
"Preach what you practice, practice what you preach"




More information about the kfm-devel mailing list