Bug 29943

Summary: 307 redirects should pass along http body and Content-Type header
Product: WebKit Reporter: Maciej Stachowiak <mjs>
Component: Page LoadingAssignee: Maciej Stachowiak <mjs>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
patch v1 beidson: review+

Maciej Stachowiak
Reported 2009-09-30 17:43:36 PDT
307 redirects should pass along the http body and Content-Type header, in addition to the method. These are dropped by CFNetwork when converting the redirect to a GET.
Attachments
patch v1 (6.25 KB, patch)
2009-09-30 17:55 PDT, Maciej Stachowiak
beidson: review+
Maciej Stachowiak
Comment 1 2009-09-30 17:55:57 PDT
Created attachment 40413 [details] patch v1
Brady Eidson
Comment 2 2009-09-30 18:00:09 PDT
Comment on attachment 40413 [details] patch v1 r=me with style issues to be fixed: > Index: WebCore/platform/network/mac/ResourceHandleMac.mm > =================================================================== > --- WebCore/platform/network/mac/ResourceHandleMac.mm (revision 48858) > +++ WebCore/platform/network/mac/ResourceHandleMac.mm (working copy) > @@ -596,6 +596,15 @@ void ResourceHandle::receivedCancellatio > if (!equalIgnoringCase(originalMethod, String([newRequest HTTPMethod]))) { > NSMutableURLRequest *mutableRequest = [newRequest mutableCopy]; > [mutableRequest setHTTPMethod:originalMethod]; > + > + FormData* body = m_handle->request().httpBody(); > + if (!equalIgnoringCase(originalMethod, "GET") && body && !body->isEmpty()) > + WebCore::setHTTPBody(mutableRequest, body); > + > + String originalContentType = m_handle->request().httpContentType(); > + if (!originalContentType.isEmpty()) > + [mutableRequest setValue:originalContentType forHTTPHeaderField:@"Content-Type"]; > + > newRequest = [mutableRequest autorelease]; > } > } There's tabs here (and therefore, maybe elsewhere in the change?) - please replace with spaces. Maybe as a result, the indentation here is off.
Maciej Stachowiak
Comment 3 2009-09-30 21:14:10 PDT
Committed, and I fixed the tabs.
Maciej Stachowiak
Comment 4 2009-09-30 21:16:08 PDT
Note You need to log in before you can comment on or make changes to this bug.