Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: Source/modules/fetch/FetchManager.cpp

Issue 1301523002: [Fetch API] Send request body as a FormData. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/fetch/FetchManager.cpp
diff --git a/Source/modules/fetch/FetchManager.cpp b/Source/modules/fetch/FetchManager.cpp
index 989297dbe59509b104bd2b9edd2ab7dba3c3915e..7886a7c85b2cb4ed60ee7c5df9a8134f2da09de5 100644
--- a/Source/modules/fetch/FetchManager.cpp
+++ b/Source/modules/fetch/FetchManager.cpp
@@ -358,12 +358,8 @@ void FetchManager::Loader::performHTTPFetch(bool corsFlag, bool corsPreflightFla
}
if (m_request->method() != "GET" && m_request->method() != "HEAD") {
- if (BodyStreamBuffer* buffer = m_request->buffer()) {
- RefPtr<BlobDataHandle> blobDataHandle = buffer->drainAsBlobDataHandle(FetchDataConsumerHandle::Reader::AllowBlobWithInvalidSize);
- RefPtr<FormData> httpBody(FormData::create());
- if (blobDataHandle)
- httpBody->appendBlob(blobDataHandle->uuid(), blobDataHandle);
- request.setHTTPBody(httpBody);
+ if (m_request->buffer()->hasBody()) {
+ request.setHTTPBody(m_request->buffer()->drainAsFormData());
}
}
request.setFetchRedirectMode(m_request->redirect());

Powered by Google App Engine
This is Rietveld 408576698