<!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>[173060] 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/173060">173060</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-08-28 06:11:21 -0700 (Thu, 28 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Add webkit_uri_response_get_http_headers to WebKit2 GTK+ API
https://bugs.webkit.org/show_bug.cgi?id=136248

Reviewed by Gustavo Noronha Silva.

Source/WebCore:

Move the code to update the SoupMessageHeaders to a new public
method.

* platform/network/soup/ResourceResponse.h:
* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::updateSoupMessageHeaders):
(WebCore::ResourceResponse::toSoupMessage):

Source/WebKit2:

Add webkit_uri_response_get_http_headers() that returns the HTTP
headers as a SoupMessageHeaders* like webkit_uri_request_get_http_headers().

* UIProcess/API/gtk/WebKitURIResponse.cpp:
(webkitURIResponseGetProperty): Add http-headers property getter.
(webkit_uri_response_class_init): Add http-headers property.
(webkit_uri_response_get_http_headers): Return the HTTP headers as
a SoupMessageHeaders* or NULL for non HTTP responses.
* UIProcess/API/gtk/WebKitURIResponse.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.

Tools:

Add new test case for webkit_uri_response_get_http_headers().

* TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:
(testURIResponseHTTPHeaders):
(serverCallback):
(beforeAll):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworksoupResourceResponseh">trunk/Source/WebCore/platform/network/soup/ResourceResponse.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworksoupResourceResponseSoupcpp">trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitURIResponsecpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitURIResponseh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestLoaderClientcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173059 => 173060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-28 09:13:58 UTC (rev 173059)
+++ trunk/Source/WebCore/ChangeLog        2014-08-28 13:11:21 UTC (rev 173060)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2014-08-28  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        [GTK] Add webkit_uri_response_get_http_headers to WebKit2 GTK+ API
+        https://bugs.webkit.org/show_bug.cgi?id=136248
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Move the code to update the SoupMessageHeaders to a new public
+        method.
+
+        * platform/network/soup/ResourceResponse.h:
+        * platform/network/soup/ResourceResponseSoup.cpp:
+        (WebCore::ResourceResponse::updateSoupMessageHeaders):
+        (WebCore::ResourceResponse::toSoupMessage):
+
+2014-08-28  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
</ins><span class="cx">         [GTK] Remove support for GTK+2 theme rendering
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=136285
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworksoupResourceResponseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/soup/ResourceResponse.h (173059 => 173060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/soup/ResourceResponse.h        2014-08-28 09:13:58 UTC (rev 173059)
+++ trunk/Source/WebCore/platform/network/soup/ResourceResponse.h        2014-08-28 13:11:21 UTC (rev 173060)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     SoupMessage* toSoupMessage() const;
</span><ins>+    void updateSoupMessageHeaders(SoupMessageHeaders*) const;
</ins><span class="cx">     void updateFromSoupMessage(SoupMessage*);
</span><span class="cx">     void updateFromSoupMessageHeaders(const SoupMessageHeaders*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworksoupResourceResponseSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp (173059 => 173060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp        2014-08-28 09:13:58 UTC (rev 173059)
+++ trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp        2014-08-28 13:11:21 UTC (rev 173060)
</span><span class="lines">@@ -33,6 +33,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+void ResourceResponse::updateSoupMessageHeaders(SoupMessageHeaders* soupHeaders) const
+{
+    for (const auto&amp; header : httpHeaderFields())
+        soup_message_headers_append(soupHeaders, header.key.utf8().data(), header.value.utf8().data());
+}
+
</ins><span class="cx"> SoupMessage* ResourceResponse::toSoupMessage() const
</span><span class="cx"> {
</span><span class="cx">     // This GET here is just because SoupMessage wants it, we dn't really know.
</span><span class="lines">@@ -42,13 +48,7 @@
</span><span class="cx"> 
</span><span class="cx">     soupMessage-&gt;status_code = httpStatusCode();
</span><span class="cx"> 
</span><del>-    const HTTPHeaderMap&amp; headers = httpHeaderFields();
-    SoupMessageHeaders* soupHeaders = soupMessage-&gt;response_headers;
-    if (!headers.isEmpty()) {
-        HTTPHeaderMap::const_iterator end = headers.end();
-        for (HTTPHeaderMap::const_iterator it = headers.begin(); it != end; ++it)
-            soup_message_headers_append(soupHeaders, it-&gt;key.utf8().data(), it-&gt;value.utf8().data());
-    }
</del><ins>+    updateSoupMessageHeaders(soupMessage-&gt;response_headers);
</ins><span class="cx"> 
</span><span class="cx">     soup_message_set_flags(soupMessage, m_soupFlags);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (173059 => 173060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-08-28 09:13:58 UTC (rev 173059)
+++ trunk/Source/WebKit2/ChangeLog        2014-08-28 13:11:21 UTC (rev 173060)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-08-28  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Add webkit_uri_response_get_http_headers to WebKit2 GTK+ API
+        https://bugs.webkit.org/show_bug.cgi?id=136248
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Add webkit_uri_response_get_http_headers() that returns the HTTP
+        headers as a SoupMessageHeaders* like webkit_uri_request_get_http_headers().
+
+        * UIProcess/API/gtk/WebKitURIResponse.cpp:
+        (webkitURIResponseGetProperty): Add http-headers property getter.
+        (webkit_uri_response_class_init): Add http-headers property.
+        (webkit_uri_response_get_http_headers): Return the HTTP headers as
+        a SoupMessageHeaders* or NULL for non HTTP responses.
+        * UIProcess/API/gtk/WebKitURIResponse.h:
+        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
+
</ins><span class="cx"> 2014-08-27  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Subpixel layout: Rename LayoutRect's device pixel snapping functions.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitURIResponsecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp (173059 => 173060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp        2014-08-28 09:13:58 UTC (rev 173059)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp        2014-08-28 13:11:21 UTC (rev 173060)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebKitPrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitURIResponsePrivate.h&quot;
</span><ins>+#include &lt;WebCore/GUniquePtrSoup.h&gt;
</ins><span class="cx"> #include &lt;glib/gi18n-lib.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -46,7 +47,8 @@
</span><span class="cx">     PROP_STATUS_CODE,
</span><span class="cx">     PROP_CONTENT_LENGTH,
</span><span class="cx">     PROP_MIME_TYPE,
</span><del>-    PROP_SUGGESTED_FILENAME
</del><ins>+    PROP_SUGGESTED_FILENAME,
+    PROP_HTTP_HEADERS
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct _WebKitURIResponsePrivate {
</span><span class="lines">@@ -54,6 +56,7 @@
</span><span class="cx">     CString uri;
</span><span class="cx">     CString mimeType;
</span><span class="cx">     CString suggestedFilename;
</span><ins>+    GUniquePtr&lt;SoupMessageHeaders&gt; httpHeaders;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WEBKIT_DEFINE_TYPE(WebKitURIResponse, webkit_uri_response, G_TYPE_OBJECT)
</span><span class="lines">@@ -78,6 +81,9 @@
</span><span class="cx">     case PROP_SUGGESTED_FILENAME:
</span><span class="cx">         g_value_set_string(value, webkit_uri_response_get_suggested_filename(response));
</span><span class="cx">         break;
</span><ins>+    case PROP_HTTP_HEADERS:
+        g_value_set_boxed(value, webkit_uri_response_get_http_headers(response));
+        break;
</ins><span class="cx">     default:
</span><span class="cx">         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
</span><span class="cx">     }
</span><span class="lines">@@ -151,6 +157,23 @@
</span><span class="cx">                                                         _(&quot;The suggested filename for the URI response&quot;),
</span><span class="cx">                                                         0,
</span><span class="cx">                                                         WEBKIT_PARAM_READABLE));
</span><ins>+
+    /**
+     * WebKitURIResponse:http-headers:
+     *
+     * The HTTP headers of the response, or %NULL if the response is not an HTTP response.
+     *
+     * Since: 2.6
+     */
+    g_object_class_install_property(
+        objectClass,
+        PROP_HTTP_HEADERS,
+        g_param_spec_boxed(
+            &quot;http-headers&quot;,
+            _(&quot;HTTP Headers&quot;),
+            _(&quot;The The HTTP headers of the response&quot;),
+            SOUP_TYPE_MESSAGE_HEADERS,
+            WEBKIT_PARAM_READABLE));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -237,6 +260,31 @@
</span><span class="cx">     return response-&gt;priv-&gt;suggestedFilename.data();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+/**
+ * webkit_uri_response_get_http_headers:
+ * @response: a #WebKitURIResponse
+ *
+ * Get the HTTP headers of a #WebKitURIResponse as a #SoupMessageHeaders.
+ *
+ * Returns: (transfer none): a #SoupMessageHeaders with the HTTP headers of @response
+ *    or %NULL if @response is not an HTTP response.
+ * Since: 2.6
+ */
+SoupMessageHeaders* webkit_uri_response_get_http_headers(WebKitURIResponse* response)
+{
+    g_return_val_if_fail(WEBKIT_IS_URI_RESPONSE(response), nullptr);
+
+    if (response-&gt;priv-&gt;httpHeaders)
+        return response-&gt;priv-&gt;httpHeaders.get();
+
+    if (!response-&gt;priv-&gt;resourceResponse.url().protocolIsInHTTPFamily())
+        return nullptr;
+
+    response-&gt;priv-&gt;httpHeaders.reset(soup_message_headers_new(SOUP_MESSAGE_HEADERS_RESPONSE));
+    response-&gt;priv-&gt;resourceResponse.updateSoupMessageHeaders(response-&gt;priv-&gt;httpHeaders.get());
+    return response-&gt;priv-&gt;httpHeaders.get();
+}
+
</ins><span class="cx"> WebKitURIResponse* webkitURIResponseCreateForResourceResponse(const WebCore::ResourceResponse&amp; resourceResponse)
</span><span class="cx"> {
</span><span class="cx">     WebKitURIResponse* uriResponse = WEBKIT_URI_RESPONSE(g_object_new(WEBKIT_TYPE_URI_RESPONSE, NULL));
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitURIResponseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h (173059 => 173060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h        2014-08-28 09:13:58 UTC (rev 173059)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.h        2014-08-28 13:11:21 UTC (rev 173060)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #define WebKitURIResponse_h
</span><span class="cx"> 
</span><span class="cx"> #include &lt;gio/gio.h&gt;
</span><ins>+#include &lt;libsoup/soup.h&gt;
</ins><span class="cx"> #include &lt;webkit2/WebKitDefines.h&gt;
</span><span class="cx"> 
</span><span class="cx"> G_BEGIN_DECLS
</span><span class="lines">@@ -74,6 +75,9 @@
</span><span class="cx"> WEBKIT_API const gchar *
</span><span class="cx"> webkit_uri_response_get_suggested_filename (WebKitURIResponse    *response);
</span><span class="cx"> 
</span><ins>+WEBKIT_API SoupMessageHeaders *
+webkit_uri_response_get_http_headers       (WebKitURIResponse    *response);
+
</ins><span class="cx"> G_END_DECLS
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt (173059 => 173060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-08-28 09:13:58 UTC (rev 173059)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-08-28 13:11:21 UTC (rev 173060)
</span><span class="lines">@@ -468,6 +468,7 @@
</span><span class="cx"> webkit_uri_response_get_content_length
</span><span class="cx"> webkit_uri_response_get_mime_type
</span><span class="cx"> webkit_uri_response_get_suggested_filename
</span><ins>+webkit_uri_response_get_http_headers
</ins><span class="cx"> 
</span><span class="cx"> &lt;SUBSECTION Standard&gt;
</span><span class="cx"> WebKitURIResponseClass
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (173059 => 173060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-08-28 09:13:58 UTC (rev 173059)
+++ trunk/Tools/ChangeLog        2014-08-28 13:11:21 UTC (rev 173060)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-08-28  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Add webkit_uri_response_get_http_headers to WebKit2 GTK+ API
+        https://bugs.webkit.org/show_bug.cgi?id=136248
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Add new test case for webkit_uri_response_get_http_headers().
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:
+        (testURIResponseHTTPHeaders):
+        (serverCallback):
+        (beforeAll):
+
</ins><span class="cx"> 2014-08-27  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         EWS status link at build.webkit.org/dashboard is incorrect until EWS pop-up is opened
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp (173059 => 173060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp        2014-08-28 09:13:58 UTC (rev 173059)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp        2014-08-28 13:11:21 UTC (rev 173060)
</span><span class="lines">@@ -396,6 +396,27 @@
</span><span class="cx">     g_assert(!strncmp(mainResourceData, &quot;1&quot;, mainResourceDataSize));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void testURIResponseHTTPHeaders(WebViewTest* test, gconstpointer)
+{
+    test-&gt;loadHtml(&quot;&lt;html&gt;&lt;body&gt;No HTTP headers&lt;/body&gt;&lt;/html&gt;&quot;, &quot;file:///&quot;);
+    test-&gt;waitUntilLoadFinished();
+    WebKitWebResource* resource = webkit_web_view_get_main_resource(test-&gt;m_webView);
+    g_assert(WEBKIT_IS_WEB_RESOURCE(resource));
+    WebKitURIResponse* response = webkit_web_resource_get_response(resource);
+    g_assert(WEBKIT_IS_URI_RESPONSE(response));
+    g_assert(!webkit_uri_response_get_http_headers(response));
+
+    test-&gt;loadURI(kServer-&gt;getURIForPath(&quot;/headers&quot;).data());
+    test-&gt;waitUntilLoadFinished();
+    resource = webkit_web_view_get_main_resource(test-&gt;m_webView);
+    g_assert(WEBKIT_IS_WEB_RESOURCE(resource));
+    response = webkit_web_resource_get_response(resource);
+    g_assert(WEBKIT_IS_URI_RESPONSE(response));
+    SoupMessageHeaders* headers = webkit_uri_response_get_http_headers(response);
+    g_assert(headers);
+    g_assert_cmpstr(soup_message_headers_get_one(headers, &quot;Foo&quot;), ==, &quot;bar&quot;);
+}
+
</ins><span class="cx"> static void serverCallback(SoupServer* server, SoupMessage* message, const char* path, GHashTable*, SoupClientContext*, gpointer)
</span><span class="cx"> {
</span><span class="cx">     static const char* responseString = &quot;&lt;html&gt;&lt;body&gt;Testing!Testing!Testing!Testing!Testing!Testing!Testing!&quot;
</span><span class="lines">@@ -433,6 +454,9 @@
</span><span class="cx">         else
</span><span class="cx">             soup_message_body_append(message-&gt;response_body, SOUP_MEMORY_STATIC, kDNTHeaderNotPresent, strlen(kDNTHeaderNotPresent));
</span><span class="cx">         soup_message_set_status(message, SOUP_STATUS_OK);
</span><ins>+    } else if (g_str_equal(path, &quot;/headers&quot;)) {
+        soup_message_headers_append(message-&gt;response_headers, &quot;Foo&quot;, &quot;bar&quot;);
+        soup_message_body_append(message-&gt;response_body, SOUP_MEMORY_STATIC, responseString, strlen(responseString));
</ins><span class="cx">     } else
</span><span class="cx">         soup_message_set_status(message, SOUP_STATUS_NOT_FOUND);
</span><span class="cx"> 
</span><span class="lines">@@ -469,6 +493,7 @@
</span><span class="cx">     ViewIsLoadingTest::add(&quot;WebKitWebView&quot;, &quot;is-loading&quot;, testWebViewIsLoading);
</span><span class="cx">     WebPageURITest::add(&quot;WebKitWebPage&quot;, &quot;get-uri&quot;, testWebPageURI);
</span><span class="cx">     WebViewTest::add(&quot;WebKitURIRequest&quot;, &quot;http-headers&quot;, testURIRequestHTTPHeaders);
</span><ins>+    WebViewTest::add(&quot;WebKitURIResponse&quot;, &quot;http-headers&quot;, testURIResponseHTTPHeaders);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void afterAll()
</span></span></pre>
</div>
</div>

</body>
</html>