RESOLVED FIXED 83349
[BlackBerry] We shouldn't set empty Content-Length & Content-Type to request's headers.
https://bugs.webkit.org/show_bug.cgi?id=83349
Summary [BlackBerry] We shouldn't set empty Content-Length & Content-Type to request...
Jason Liu
Reported 2012-04-05 20:56:05 PDT
When there is a redirection for a POST request, we change POST to GET and make Content-Length/Content-Type to empty string. We should remove these headers instead of adding empty strings.
Attachments
Patch (3.71 KB, patch)
2012-04-05 21:26 PDT, Jason Liu
no flags
Patch (3.86 KB, patch)
2012-04-11 23:13 PDT, Jason Liu
no flags
Jason Liu
Comment 1 2012-04-05 21:26:43 PDT
Leo Yang
Comment 2 2012-04-06 00:54:41 PDT
Comment on attachment 135979 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=135979&action=review > Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp:210 > + m_httpHeaderFields.remove("Content-Length"); > + > + if (url().protocolInHTTPFamily()) > + m_platformRequestUpdated = false; Just ASSERT(url().protocolInHTTPFamily()) instead of *if* branch? > Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp:220 > + m_httpHeaderFields.remove("Content-Type"); > + > + if (url().protocolInHTTPFamily()) > + m_platformRequestUpdated = false; Ditto.
Jason Liu
Comment 3 2012-04-06 01:20:38 PDT
(In reply to comment #2) > (From update of attachment 135979 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=135979&action=review > > > Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp:210 > > + m_httpHeaderFields.remove("Content-Length"); > > + > > + if (url().protocolInHTTPFamily()) > > + m_platformRequestUpdated = false; > > Just ASSERT(url().protocolInHTTPFamily()) instead of *if* branch? > > > Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp:220 > > + m_httpHeaderFields.remove("Content-Type"); > > + > > + if (url().protocolInHTTPFamily()) > > + m_platformRequestUpdated = false; > > Ditto. Why don't we do as clearHTTPReferrer? If we remove this *if* branch, "updateResourceRequest();" can be moved, too.
Jason Liu
Comment 4 2012-04-09 02:06:57 PDT
r?
Leo Yang
Comment 5 2012-04-09 19:16:21 PDT
Comment on attachment 135979 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=135979&action=review OK, let's keep consistent with clearHTTPReferrer. Looks good to me. >>> Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp:210 >>> + m_httpHeaderFields.remove("Content-Length"); >>> + >>> + if (url().protocolInHTTPFamily()) >>> + m_platformRequestUpdated = false; >> >> Just ASSERT(url().protocolInHTTPFamily()) instead of *if* branch? > > Why don't we do as clearHTTPReferrer? > If we remove this *if* branch, "updateResourceRequest();" can be moved, too. Just ASSERT(url().protocolInHTTPFamily()) instead of *if* branch? >> Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp:220 >> + m_httpHeaderFields.remove("Content-Type"); >> + >> + if (url().protocolInHTTPFamily()) >> + m_platformRequestUpdated = false; > > Ditto. Ditto.
George Staikos
Comment 6 2012-04-11 22:52:43 PDT
Comment on attachment 135979 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=135979&action=review I agree with Leo's comments. > Source/WebCore/platform/network/blackberry/NetworkJob.cpp:587 > if ((method != "GET") && (method != "HEAD")) { There are extra parentheses here
Jason Liu
Comment 7 2012-04-11 23:13:44 PDT
Jason Liu
Comment 8 2012-04-11 23:19:46 PDT
(In reply to comment #6) > (From update of attachment 135979 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=135979&action=review > > I agree with Leo's comments. These two functions are written according to ResourceRequestBase::clearHTTPReferrer(). And Leo's comment #5 has approved. > > Source/WebCore/platform/network/blackberry/NetworkJob.cpp:587 > > if ((method != "GET") && (method != "HEAD")) { > > There are extra parentheses here I amended this issue in the new patch.
WebKit Review Bot
Comment 9 2012-04-12 01:37:43 PDT
Comment on attachment 136830 [details] Patch Clearing flags on attachment: 136830 Committed r113950: <http://trac.webkit.org/changeset/113950>
WebKit Review Bot
Comment 10 2012-04-12 01:37:48 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.