Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
KDE Libraries
Commits
1ca33c08
Commit
1ca33c08
authored
May 07, 2011
by
Dawit Alemayehu
Browse files
Workaround QtWebKit's incorrect handling redirection of a POST operation.
See
http://webkit.org/b/60440
for the details. CCBUG: 269694
parent
ebd556b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
kio/kio/accessmanager.cpp
View file @
1ca33c08
...
...
@@ -237,18 +237,26 @@ QNetworkReply *AccessManager::createRequest(Operation op, const QNetworkRequest
KIO
::
MetaData
metaData
;
d
->
setMetaDataForRequest
(
req
,
metaData
);
kioJob
->
addMetaData
(
metaData
);
if
(
op
==
PostOperation
&&
!
kioJob
->
metaData
()
.
contains
(
QL1S
(
"content-type"
)))
{
if
(
op
==
PostOperation
&&
!
metaData
.
contains
(
QL1S
(
"content-type"
)))
{
const
QVariant
header
=
req
.
header
(
QNetworkRequest
::
ContentTypeHeader
);
if
(
header
.
isValid
())
kioJob
->
addMetaData
(
QL1S
(
"content-type"
),
(
QL1S
(
"Content-Type: "
)
+
header
.
toString
()));
else
kioJob
->
addMetaData
(
QL1S
(
"content-type"
),
QL1S
(
"Content-Type: application/x-www-form-urlencoded"
));
if
(
header
.
isValid
())
{
metaData
.
insert
(
QL1S
(
"content-type"
),
(
QL1S
(
"Content-Type: "
)
+
header
.
toString
()));
}
else
{
metaData
.
insert
(
QL1S
(
"content-type"
),
QL1S
(
"Content-Type: application/x-www-form-urlencoded"
));
}
}
// WORKAROUND: Remove the incorrectly included Content-Type header by QtWebKit
// when a POST operation gets redirected a GET (BR# 269694).
if
(
op
==
GetOperation
&&
metaData
.
contains
(
QL1S
(
"content-type"
)))
{
metaData
.
remove
(
QL1S
(
"content-type"
));
}
kioJob
->
addMetaData
(
metaData
);
return
reply
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment