<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[214243] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/214243">214243</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2017-03-22 01:41:44 -0700 (Wed, 22 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Several WPT tests are failing since they were added in the last update in <a href="http://trac.webkit.org/projects/webkit/changeset/213882">r213882</a>
https://bugs.webkit.org/show_bug.cgi?id=169915

Reviewed by Michael Catanzaro.

Tools:

Add libsoup patch to not fail loads when there's no empty line after the headers in responses with no body.

* gtk/jhbuild.modules:
* gtk/patches/libsoup-soup-message-io-Do-not-fail-when-there-s-no-empty-li.patch: Added.

LayoutTests:

They fail because libsoup fails to load the requests because the response doesn't include the empty line after the
headers while other browsers allow that. Even with libsoup patched we still need platform specific expectations
for imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders.htm, because libsoup caches all header
names, so the first time foo-test header is cached and then always used no matter what case is used. The results
are still valid in any case.

* platform/gtk/imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders-expected.txt: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsgtkjhbuildmodules">trunk/Tools/gtk/jhbuild.modules</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/XMLHttpRequest/</li>
<li><a href="#trunkLayoutTestsplatformgtkimportedw3cwebplatformtestsXMLHttpRequestgetallresponseheadersexpectedtxt">trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders-expected.txt</a></li>
<li><a href="#trunkToolsgtkpatcheslibsoupsoupmessageioDonotfailwhentheresnoemptylipatch">trunk/Tools/gtk/patches/libsoup-soup-message-io-Do-not-fail-when-there-s-no-empty-li.patch</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (214242 => 214243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-22 07:15:16 UTC (rev 214242)
+++ trunk/LayoutTests/ChangeLog        2017-03-22 08:41:44 UTC (rev 214243)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2017-03-22  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Several WPT tests are failing since they were added in the last update in r213882
+        https://bugs.webkit.org/show_bug.cgi?id=169915
+
+        Reviewed by Michael Catanzaro.
+
+        They fail because libsoup fails to load the requests because the response doesn't include the empty line after the
+        headers while other browsers allow that. Even with libsoup patched we still need platform specific expectations
+        for imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders.htm, because libsoup caches all header
+        names, so the first time foo-test header is cached and then always used no matter what case is used. The results
+        are still valid in any case.
+
+        * platform/gtk/imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders-expected.txt: Added.
+
</ins><span class="cx"> 2017-03-21  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Migrate off of CTFontCreateForCSS
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkimportedw3cwebplatformtestsXMLHttpRequestgetallresponseheadersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders-expected.txt (0 => 214243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/XMLHttpRequest/getallresponseheaders-expected.txt        2017-03-22 08:41:44 UTC (rev 214243)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+PASS XMLHttpRequest: getAllResponseHeaders() 
+FAIL XMLHttpRequest: getAllResponseHeaders() 1 assert_equals: expected &quot;also-here: Mr. PB\r\newok: lego\r\nfoo-test: 1, 2\r\n&quot; but got &quot;ALSO-here: Mr. PB\r\nfoo-test: 1, 2\r\newok: lego\r\n&quot;
+
</ins></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (214242 => 214243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-03-22 07:15:16 UTC (rev 214242)
+++ trunk/Tools/ChangeLog        2017-03-22 08:41:44 UTC (rev 214243)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-03-22  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Several WPT tests are failing since they were added in the last update in r213882
+        https://bugs.webkit.org/show_bug.cgi?id=169915
+
+        Reviewed by Michael Catanzaro.
+
+        Add libsoup patch to not fail loads when there's no empty line after the headers in responses with no body.
+
+        * gtk/jhbuild.modules:
+        * gtk/patches/libsoup-soup-message-io-Do-not-fail-when-there-s-no-empty-li.patch: Added.
+
</ins><span class="cx"> 2017-03-20  Matt Rajca  &lt;mrajca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Loosen audio playback restrictions when the volume is 0.
</span></span></pre></div>
<a id="trunkToolsgtkjhbuildmodules"></a>
<div class="modfile"><h4>Modified: trunk/Tools/gtk/jhbuild.modules (214242 => 214243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/jhbuild.modules        2017-03-22 07:15:16 UTC (rev 214242)
+++ trunk/Tools/gtk/jhbuild.modules        2017-03-22 08:41:44 UTC (rev 214243)
</span><span class="lines">@@ -245,6 +245,7 @@
</span><span class="cx">             hash=&quot;sha256:ca1ca037e89e8bc7b782559f3ec5d89c9d0b836f505b2f95e008ed517fd6658f&quot;&gt;
</span><span class="cx">       &lt;patch file=&quot;libsoup-auth-Fix-async-authentication-when-flag-SOUP_MESSAGE.patch&quot; strip=&quot;1&quot;/&gt;
</span><span class="cx">       &lt;patch file=&quot;libsoup-auth-do-not-use-cached-credentials-in-lookup-method-.patch&quot; strip=&quot;1&quot;/&gt;
</span><ins>+      &lt;patch file=&quot;libsoup-soup-message-io-Do-not-fail-when-there-s-no-empty-li.patch&quot; strip=&quot;1&quot;/&gt;
</ins><span class="cx">     &lt;/branch&gt;
</span><span class="cx">   &lt;/autotools&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsgtkpatcheslibsoupsoupmessageioDonotfailwhentheresnoemptylipatch"></a>
<div class="addfile"><h4>Added: trunk/Tools/gtk/patches/libsoup-soup-message-io-Do-not-fail-when-there-s-no-empty-li.patch (0 => 214243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/patches/libsoup-soup-message-io-Do-not-fail-when-there-s-no-empty-li.patch                                (rev 0)
+++ trunk/Tools/gtk/patches/libsoup-soup-message-io-Do-not-fail-when-there-s-no-empty-li.patch        2017-03-22 08:41:44 UTC (rev 214243)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+From bb23caf7db4e9112089e1502aa8c106178095e7e Mon Sep 17 00:00:00 2001
+From: Carlos Garcia Campos &lt;cgarcia@igalia.com&gt;
+Date: Tue, 21 Mar 2017 14:19:46 +0100
+Subject: [PATCH] soup-message-io: Do not fail when there's no empty line after
+ headers
+
+The spec says there should be an empty line (\r\n) between the response
+headers and the body. However, some servers don't include the empty line
+when the response doesn't have a body. This is causing several WebKit
+tests to fail, because some of the imported w3c tests do not include
+that empty line. Those tests pass in firefox, chromium and safari, so at
+least those other browsers allow that.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780352
+---
+ libsoup/soup-message-io.c | 34 ++++++++++++++++++++--------------
+ 1 file changed, 20 insertions(+), 14 deletions(-)
+
+diff --git a/libsoup/soup-message-io.c b/libsoup/soup-message-io.c
+index e893ec2a..ea02b1e3 100644
+--- a/libsoup/soup-message-io.c
++++ b/libsoup/soup-message-io.c
+@@ -229,12 +229,16 @@ read_headers (SoupMessage *msg, gboolean blocking,
+                                                             cancellable, error);
+                 io-&gt;read_header_buf-&gt;len = old_len + MAX (nread, 0);
+                 if (nread == 0) {
+-                        soup_message_set_status (msg, SOUP_STATUS_MALFORMED);
+-                        g_set_error_literal (error, G_IO_ERROR,
+-                                             G_IO_ERROR_PARTIAL_INPUT,
+-                                             _(&quot;Connection terminated unexpectedly&quot;));
++                        if (io-&gt;read_header_buf-&gt;len == 0) {
++                                soup_message_set_status (msg, SOUP_STATUS_MALFORMED);
++                                g_set_error_literal (error, G_IO_ERROR,
++                                                     G_IO_ERROR_PARTIAL_INPUT,
++                                                     _(&quot;Connection terminated unexpectedly&quot;));
++                                return FALSE;
++                        }
++                        break;
+                 }
+-                if (nread &lt;= 0)
++                if (nread &lt; 0)
+                         return FALSE;

+                 if (got_lf) {
+@@ -251,15 +255,17 @@ read_headers (SoupMessage *msg, gboolean blocking,
+                 }
+         }

+-        /* We need to &quot;rewind&quot; io-&gt;read_header_buf back one line.
+-         * That SHOULD be two characters (CR LF), but if the
+-         * web server was stupid, it might only be one.
+-         */
+-        if (io-&gt;read_header_buf-&gt;len &lt; 3 ||
+-            io-&gt;read_header_buf-&gt;data[io-&gt;read_header_buf-&gt;len - 2] == '\n')
+-                io-&gt;read_header_buf-&gt;len--;
+-        else
+-                io-&gt;read_header_buf-&gt;len -= 2;
++        if (got_lf) {
++                /* We need to &quot;rewind&quot; io-&gt;read_header_buf back one line.
++                 * That SHOULD be two characters (CR LF), but if the
++                 * web server was stupid, it might only be one.
++                 */
++                if (io-&gt;read_header_buf-&gt;len &lt; 3 ||
++                    io-&gt;read_header_buf-&gt;data[io-&gt;read_header_buf-&gt;len - 2] == '\n')
++                        io-&gt;read_header_buf-&gt;len--;
++                else
++                        io-&gt;read_header_buf-&gt;len -= 2;
++        }
+         io-&gt;read_header_buf-&gt;data[io-&gt;read_header_buf-&gt;len] = '\0';

+         return TRUE;
+-- 
+2.11.0
+
</ins></span></pre>
</div>
</div>

</body>
</html>