Serialize ResourceResponses using WebKit types
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Sep 2014 17:58:46 +0000 (17:58 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Sep 2014 17:58:46 +0000 (17:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136545

Fix the failing webarchive tests.

* platform/network/mac/ResourceResponseMac.mm:
(WebCore::ResourceResponse::initNSURLResponse): Map empty text encoding name to nil NSString.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/mac/ResourceResponseMac.mm

index d823dc1..84e008f 100644 (file)
@@ -1,3 +1,13 @@
+2014-09-06  Antti Koivisto  <antti@apple.com>
+
+        Serialize ResourceResponses using WebKit types
+        https://bugs.webkit.org/show_bug.cgi?id=136545
+
+        Fix the failing webarchive tests.
+
+        * platform/network/mac/ResourceResponseMac.mm:
+        (WebCore::ResourceResponse::initNSURLResponse): Map empty text encoding name to nil NSString.
+
 2014-09-06  peavo@outlook.com  <peavo@outlook.com>
 
         [WinCairo][Curl] fileExists() incorrectly claims folder does not exist.
index 1adf2b7..896baee 100644 (file)
@@ -55,7 +55,8 @@ void ResourceResponse::initNSURLResponse() const
         else
             expectedContentLength = static_cast<NSInteger>(m_expectedContentLength);
 
-        m_nsResponse = adoptNS([[NSURLResponse alloc] initWithURL:m_url MIMEType:m_mimeType expectedContentLength:expectedContentLength textEncodingName:m_textEncodingName]);
+        NSString* encodingNSString = nsStringNilIfEmpty(m_textEncodingName);
+        m_nsResponse = adoptNS([[NSURLResponse alloc] initWithURL:m_url MIMEType:m_mimeType expectedContentLength:expectedContentLength textEncodingName:encodingNSString]);
         return;
     }