Title: [99104] trunk/Source/WebCore
Revision
99104
Author
[email protected]
Date
2011-11-02 15:24:50 -0700 (Wed, 02 Nov 2011)

Log Message

Emedded PDFs cannot be opened from Web archives
https://bugs.webkit.org/show_bug.cgi?id=70954

Reviewed by Oliver Hunt.

BuiltInPDFPlugin doesn't have access to original ResourceResponse and has to re-create it
It doesn't seem to be possible to create an NSURLResponse with a non-null HTTP status code,
and NetscapePlugInStreamLoader becomes unhappy.

* loader/NetscapePlugInStreamLoader.cpp: (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
Allow 0 status code, it's not a real error to have one in response.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (99103 => 99104)


--- trunk/Source/WebCore/ChangeLog	2011-11-02 22:13:26 UTC (rev 99103)
+++ trunk/Source/WebCore/ChangeLog	2011-11-02 22:24:50 UTC (rev 99104)
@@ -1,3 +1,17 @@
+2011-11-02  Alexey Proskuryakov  <[email protected]>
+
+        Emedded PDFs cannot be opened from Web archives
+        https://bugs.webkit.org/show_bug.cgi?id=70954
+
+        Reviewed by Oliver Hunt.
+
+        BuiltInPDFPlugin doesn't have access to original ResourceResponse and has to re-create it
+        It doesn't seem to be possible to create an NSURLResponse with a non-null HTTP status code,
+        and NetscapePlugInStreamLoader becomes unhappy.
+
+        * loader/NetscapePlugInStreamLoader.cpp: (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
+        Allow 0 status code, it's not a real error to have one in response.
+
 2011-10-31  Nat Duca  <[email protected]>
 
         [chromium] Slow down commit and draw rate based on visibility and draw completion

Modified: trunk/Source/WebCore/loader/NetscapePlugInStreamLoader.cpp (99103 => 99104)


--- trunk/Source/WebCore/loader/NetscapePlugInStreamLoader.cpp	2011-11-02 22:13:26 UTC (rev 99103)
+++ trunk/Source/WebCore/loader/NetscapePlugInStreamLoader.cpp	2011-11-02 22:24:50 UTC (rev 99104)
@@ -87,8 +87,9 @@
     
     if (m_client->wantsAllStreams())
         return;
-    
-    if (response.httpStatusCode() < 100 || response.httpStatusCode() >= 400)
+
+    // Status code can be null when serving from a Web archive.
+    if (response.httpStatusCode() && (response.httpStatusCode() < 100 || response.httpStatusCode() >= 400))
         cancel(frameLoader()->client()->fileDoesNotExistError(response));
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to