Give NPAPI post requests a default content type
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jun 2014 21:03:37 +0000 (21:03 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jun 2014 21:03:37 +0000 (21:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134120

Reviewed by Andreas Kling.

Source/WebCore:
* WebCore.exp.in:

Source/WebKit2:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::loadURL):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/PluginView.cpp

index b639a73a826ff38ec424ed31e82c2750248ab3c0..c1913e9be1bc52456f48308792b9a63af57a99b0 100644 (file)
@@ -1,3 +1,12 @@
+2014-06-20  Anders Carlsson  <andersca@apple.com>
+
+        Give NPAPI post requests a default content type
+        https://bugs.webkit.org/show_bug.cgi?id=134120
+
+        Reviewed by Andreas Kling.
+
+        * WebCore.exp.in:
+
 2014-06-20  Simon Fraser  <simon.fraser@apple.com>
 
         REGRESSION (r169972): fix issue when removing masks from compositing layers
 2014-06-20  Simon Fraser  <simon.fraser@apple.com>
 
         REGRESSION (r169972): fix issue when removing masks from compositing layers
index fb6c6934fca5d1126a65443f6a2a629ae8591a71..b394793b392f8a7d11b5f81b96e494fd16b094c2 100644 (file)
@@ -817,6 +817,7 @@ __ZN7WebCore19MediaSessionManager9addClientEPNS_25MediaSessionManagerClientE
 __ZN7WebCore19ResourceRequestBase11setHTTPBodyEN3WTF10PassRefPtrINS_8FormDataEEE
 __ZN7WebCore19ResourceRequestBase13setHTTPMethodERKN3WTF6StringE
 __ZN7WebCore19ResourceRequestBase15setHTTPReferrerERKN3WTF6StringE
 __ZN7WebCore19ResourceRequestBase11setHTTPBodyEN3WTF10PassRefPtrINS_8FormDataEEE
 __ZN7WebCore19ResourceRequestBase13setHTTPMethodERKN3WTF6StringE
 __ZN7WebCore19ResourceRequestBase15setHTTPReferrerERKN3WTF6StringE
+__ZN7WebCore19ResourceRequestBase18setHTTPContentTypeERKN3WTF6StringE
 __ZN7WebCore19ResourceRequestBase19setHTTPHeaderFieldsENS_13HTTPHeaderMapE
 __ZN7WebCore19ResourceRequestBase22defaultTimeoutIntervalEv
 __ZN7WebCore19ResourceRequestBase24s_defaultTimeoutIntervalE
 __ZN7WebCore19ResourceRequestBase19setHTTPHeaderFieldsENS_13HTTPHeaderMapE
 __ZN7WebCore19ResourceRequestBase22defaultTimeoutIntervalEv
 __ZN7WebCore19ResourceRequestBase24s_defaultTimeoutIntervalE
@@ -1785,6 +1786,7 @@ __ZNK7WebCore19InspectorController29buildObjectForHighlightedNodeEv
 __ZNK7WebCore19MediaSessionManager30applicationWillEnterBackgroundEv
 __ZNK7WebCore19MediaSessionManager30applicationWillEnterForegroundEv
 __ZNK7WebCore19ResourceRequestBase10httpMethodEv
 __ZNK7WebCore19MediaSessionManager30applicationWillEnterBackgroundEv
 __ZNK7WebCore19MediaSessionManager30applicationWillEnterForegroundEv
 __ZNK7WebCore19ResourceRequestBase10httpMethodEv
+__ZNK7WebCore19ResourceRequestBase15httpContentTypeEv
 __ZNK7WebCore19ResourceRequestBase20firstPartyForCookiesEv
 __ZNK7WebCore19ResourceRequestBase3urlEv
 __ZNK7WebCore19ResourceRequestBase6isNullEv
 __ZNK7WebCore19ResourceRequestBase20firstPartyForCookiesEv
 __ZNK7WebCore19ResourceRequestBase3urlEv
 __ZNK7WebCore19ResourceRequestBase6isNullEv
index 113d7521cedf5e385480ff35e755005c03885b6b..3985f14a084fc66cd81d05929c66e888d8824342 100644 (file)
@@ -1,3 +1,13 @@
+2014-06-20  Anders Carlsson  <andersca@apple.com>
+
+        Give NPAPI post requests a default content type
+        https://bugs.webkit.org/show_bug.cgi?id=134120
+
+        Reviewed by Andreas Kling.
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::loadURL):
+
 2014-06-20  Simon Fraser  <simon.fraser@apple.com>
 
         Always commit the scrolling tree when we flush layers
 2014-06-20  Simon Fraser  <simon.fraser@apple.com>
 
         Always commit the scrolling tree when we flush layers
index a4e1ae08972bb192073309e4736cf3c58b1e97c7..771fb8e56e3e8919ee5616fa15d80d3d0f741b66 100644 (file)
@@ -1336,7 +1336,12 @@ void PluginView::loadURL(uint64_t requestID, const String& method, const String&
     frameLoadRequest.resourceRequest().setHTTPMethod(method);
     frameLoadRequest.resourceRequest().setURL(m_pluginElement->document().completeURL(urlString));
     frameLoadRequest.resourceRequest().setHTTPHeaderFields(headerFields);
     frameLoadRequest.resourceRequest().setHTTPMethod(method);
     frameLoadRequest.resourceRequest().setURL(m_pluginElement->document().completeURL(urlString));
     frameLoadRequest.resourceRequest().setHTTPHeaderFields(headerFields);
-    frameLoadRequest.resourceRequest().setHTTPBody(FormData::create(httpBody.data(), httpBody.size()));
+    if (!httpBody.isEmpty()) {
+        frameLoadRequest.resourceRequest().setHTTPBody(FormData::create(httpBody.data(), httpBody.size()));
+        if (frameLoadRequest.resourceRequest().httpContentType().isEmpty())
+            frameLoadRequest.resourceRequest().setHTTPContentType("application/x-www-form-urlencoded");
+    }
+
     frameLoadRequest.setFrameName(target);
 
     String referrer = SecurityPolicy::generateReferrerHeader(frame()->document()->referrerPolicy(), frameLoadRequest.resourceRequest().url(), frame()->loader().outgoingReferrer());
     frameLoadRequest.setFrameName(target);
 
     String referrer = SecurityPolicy::generateReferrerHeader(frame()->document()->referrerPolicy(), frameLoadRequest.resourceRequest().url(), frame()->loader().outgoingReferrer());