Title: [206086] trunk/Source/WebKit2
Revision
206086
Author
mcatanz...@igalia.com
Date
2016-09-18 23:51:23 -0700 (Sun, 18 Sep 2016)

Log Message

[GTK] Empty referer header after WebKit session state restoration trips Bad Behavior Wordpress plugin
https://bugs.webkit.org/show_bug.cgi?id=159606

Reviewed by Carlos Garcia Campos.

Leave the referrer member of FrameState unset when restoring from session state, unless
there is actually a nonempty referrer saved in the state. If we set it to an empty string,
then an empty referrer gets sent to the server, which some servers do not accept. It
triggers the Bad Behavior plugin on my WordPress blog, for instance. It also breaks vox.com.

* UIProcess/API/gtk/WebKitWebViewSessionState.cpp:
(decodeFrameState):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (206085 => 206086)


--- trunk/Source/WebKit2/ChangeLog	2016-09-18 19:49:28 UTC (rev 206085)
+++ trunk/Source/WebKit2/ChangeLog	2016-09-19 06:51:23 UTC (rev 206086)
@@ -1,3 +1,18 @@
+2016-09-18  Michael Catanzaro  <mcatanz...@igalia.com>
+
+        [GTK] Empty referer header after WebKit session state restoration trips Bad Behavior Wordpress plugin
+        https://bugs.webkit.org/show_bug.cgi?id=159606
+
+        Reviewed by Carlos Garcia Campos.
+
+        Leave the referrer member of FrameState unset when restoring from session state, unless
+        there is actually a nonempty referrer saved in the state. If we set it to an empty string,
+        then an empty referrer gets sent to the server, which some servers do not accept. It
+        triggers the Bad Behavior plugin on my WordPress blog, for instance. It also breaks vox.com.
+
+        * UIProcess/API/gtk/WebKitWebViewSessionState.cpp:
+        (decodeFrameState):
+
 2016-09-18  Chelsea Pugh  <cp...@apple.com>
 
         [iOS] Remove unused methods from _WKInputDelegate

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionState.cpp (206085 => 206086)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionState.cpp	2016-09-18 19:49:28 UTC (rev 206085)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionState.cpp	2016-09-19 06:51:23 UTC (rev 206086)
@@ -293,7 +293,10 @@
         &scrollPositionX, &scrollPositionY, &pageScaleFactor, &httpBodyVariant, &childrenIter.outPtr());
     frameState.urlString = String::fromUTF8(urlString);
     frameState.originalURLString = String::fromUTF8(originalURLString);
-    frameState.referrer = String::fromUTF8(referrer);
+    // frameState.referrer must not be an empty string since we never want to
+    // send an empty Referer header. Bug #159606.
+    if (strlen(referrer))
+        frameState.referrer = String::fromUTF8(referrer);
     frameState.target = String::fromUTF8(target);
     if (gsize documentStateLength = g_variant_iter_n_children(documentStateIter.get())) {
         frameState.documentState.reserveInitialCapacity(documentStateLength);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to