Bug 267249 - Last commit to KIO::AccessManager (3f3ed98) breaks http POST
Summary: Last commit to KIO::AccessManager (3f3ed98) breaks http POST
Status: RESOLVED NOT A BUG
Alias: None
Product: kwebkitpart
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: webkit-devel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-27 13:37 UTC by Michael Olbrich
Modified: 2011-02-28 01:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
possible fix (1.95 KB, patch)
2011-02-27 13:37 UTC, Michael Olbrich
Details

Note You need to log in before you can comment on or make changes to this bug.
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.