Bug 267249

Summary: Last commit to KIO::AccessManager (3f3ed98) breaks http POST
Product: [Frameworks and Libraries] kwebkitpart Reporter: Michael Olbrich <michael.olbrich>
Component: generalAssignee: webkit-devel
Status: RESOLVED NOT A BUG    
Severity: normal CC: adawit
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: possible fix

Description Michael Olbrich 2011-02-27 13:37:01 UTC
Created attachment 57550 [details]
possible fix

Version:           unspecified (using Devel) 
OS:                Linux

In KIO::AccessManager::createRequest:

Since 3f3ed98 the new KIO::http_post API is used. For this to work, the request size is needed. Whenever I try to use a form (e.g. lwn.net login) this fails because sizeFromRequest(req) returns -1.
I'm not certain what part is to blame for this. I'm using qtwebkit 2.1.0~2011week03-1 debian packages.

I've attached a patch that creates a fall back to the old API if the size is not available. I'm not sure, if this the right fix, or if the bug is somewhere else.

Reproducible: Always
Comment 1 Dawit Alemayehu 2011-02-28 01:37:48 UTC
That is curious. The only way sizeFromRequest returns a -1 is if "Content-Length" is missing. Hmm... curious why QtWebKit does not set that information by the time QNetworkAccessManager::createRequest is invoked!

Anyhow, there is no need for this patch because the requirement that the size MUST always be specified before the http ioslave did any POST operation has already been relaxed due to the very same problem with the PUT operation. If you update to the latest version of kdelibs/kioslave/http/http.cpp (22ff0c7 and newer), then you should not encounter this problem. Otherwise, please re-open this ticket...

Thanks for the report.