Title: [290688] branches/safari-613-branch
Revision
290688
Author
[email protected]
Date
2022-03-01 15:49:11 -0800 (Tue, 01 Mar 2022)

Log Message

Cherry-pick r289502. rdar://problem/88528286

    WKWebView: WKURLSchemeHandler “request to the end of the resource” produces an invalid header
    https://bugs.webkit.org/show_bug.cgi?id=236401
    rdar://88528286

    Reviewed by Brent Fulgham.

    Source/WebCore:

    https://webkit.org/b/203302 added support for Range requests to AVAssetResourceLoadingDataRequest,
    but it incorrectly used '*' instead of '' for "last-byte-pos:" for a request to the end of the resource.

    API test URLSchemeHandler.Ranges was updated.

    * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
    (WebCore::WebCoreAVFResourceLoader::startLoading):

    Tools:

    * TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:

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

Modified Paths

Diff

Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (290687 => 290688)


--- branches/safari-613-branch/Source/WebCore/ChangeLog	2022-03-01 23:49:07 UTC (rev 290687)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog	2022-03-01 23:49:11 UTC (rev 290688)
@@ -1,5 +1,51 @@
 2022-02-28  Russell Epstein  <[email protected]>
 
+        Cherry-pick r289502. rdar://problem/88528286
+
+    WKWebView: WKURLSchemeHandler “request to the end of the resource” produces an invalid header
+    https://bugs.webkit.org/show_bug.cgi?id=236401
+    rdar://88528286
+    
+    Reviewed by Brent Fulgham.
+    
+    Source/WebCore:
+    
+    
+    https://webkit.org/b/203302 added support for Range requests to AVAssetResourceLoadingDataRequest,
+    but it incorrectly used '*' instead of '' for "last-byte-pos:" for a request to the end of the resource.
+    
+    API test URLSchemeHandler.Ranges was updated.
+    
+    * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
+    (WebCore::WebCoreAVFResourceLoader::startLoading):
+    
+    Tools:
+    
+    * TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-09  Eric Carlson  <[email protected]>
+
+            WKWebView: WKURLSchemeHandler “request to the end of the resource” produces an invalid header
+            https://bugs.webkit.org/show_bug.cgi?id=236401
+            rdar://88528286
+
+            Reviewed by Brent Fulgham.
+
+            Patch by Jer Noble.
+
+            https://webkit.org/b/203302 added support for Range requests to AVAssetResourceLoadingDataRequest,
+            but it incorrectly used '*' instead of '' for "last-byte-pos:" for a request to the end of the resource.
+
+            API test URLSchemeHandler.Ranges was updated.
+
+            * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
+            (WebCore::WebCoreAVFResourceLoader::startLoading):
+
+2022-02-28  Russell Epstein  <[email protected]>
+
         Cherry-pick r289493. rdar://problem/88321921
 
     Register strings in CSSTokenizer created from preprocessing

Modified: branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm (290687 => 290688)


--- branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm	2022-03-01 23:49:07 UTC (rev 290687)
+++ branches/safari-613-branch/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm	2022-03-01 23:49:11 UTC (rev 290688)
@@ -288,7 +288,7 @@
 
     if (AVAssetResourceLoadingDataRequest *dataRequest = [m_avRequest dataRequest]; dataRequest.requestedLength
         && !request.hasHTTPHeaderField(HTTPHeaderName::Range)) {
-        String rangeEnd = dataRequest.requestsAllDataToEndOfResource ? "*"_s : makeString(dataRequest.requestedOffset + dataRequest.requestedLength - 1);
+        String rangeEnd = dataRequest.requestsAllDataToEndOfResource ? emptyString() : makeString(dataRequest.requestedOffset + dataRequest.requestedLength - 1);
         request.addHTTPHeaderField(HTTPHeaderName::Range, makeString("bytes=", dataRequest.requestedOffset, '-', rangeEnd));
     }
 

Modified: branches/safari-613-branch/Tools/ChangeLog (290687 => 290688)


--- branches/safari-613-branch/Tools/ChangeLog	2022-03-01 23:49:07 UTC (rev 290687)
+++ branches/safari-613-branch/Tools/ChangeLog	2022-03-01 23:49:11 UTC (rev 290688)
@@ -1,3 +1,41 @@
+2022-02-28  Russell Epstein  <[email protected]>
+
+        Cherry-pick r289502. rdar://problem/88528286
+
+    WKWebView: WKURLSchemeHandler “request to the end of the resource” produces an invalid header
+    https://bugs.webkit.org/show_bug.cgi?id=236401
+    rdar://88528286
+    
+    Reviewed by Brent Fulgham.
+    
+    Source/WebCore:
+    
+    
+    https://webkit.org/b/203302 added support for Range requests to AVAssetResourceLoadingDataRequest,
+    but it incorrectly used '*' instead of '' for "last-byte-pos:" for a request to the end of the resource.
+    
+    API test URLSchemeHandler.Ranges was updated.
+    
+    * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
+    (WebCore::WebCoreAVFResourceLoader::startLoading):
+    
+    Tools:
+    
+    * TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-09  Eric Carlson  <[email protected]>
+
+            WKWebView: WKURLSchemeHandler “request to the end of the resource” produces an invalid header
+            https://bugs.webkit.org/show_bug.cgi?id=236401
+            rdar://88528286
+
+            Reviewed by Brent Fulgham.
+
+            * TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:
+
 2022-02-07  Russell Epstein  <[email protected]>
 
         Cherry-pick r288605. rdar://problem/87948317

Modified: branches/safari-613-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm (290687 => 290688)


--- branches/safari-613-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm	2022-03-01 23:49:07 UTC (rev 290687)
+++ branches/safari-613-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm	2022-03-01 23:49:11 UTC (rev 290688)
@@ -1606,7 +1606,7 @@
         auto rangeBeginString = requestRangeString.substring(begin + rangeBytes.length(), dash - begin - rangeBytes.length());
         auto rangeEndString = requestRangeString.substring(dash + 1, end - dash - 1);
         auto rangeBegin = parseInteger<uint64_t>(rangeBeginString).value_or(0);
-        auto rangeEnd = rangeEndString == "*" ? [videoData length] - 1 : parseInteger<uint64_t>(rangeEndString).value_or(0);
+        auto rangeEnd = rangeEndString.isEmpty() ? [videoData length] - 1 : parseInteger<uint64_t>(rangeEndString).value_or(0);
         auto contentLength = rangeEnd - rangeBegin + 1;
 
         auto response = adoptNS([[NSHTTPURLResponse alloc] initWithURL:[NSURL URLWithString:@"https://webkit.org/"] statusCode:206 HTTPVersion:@"HTTP/1.1" headerFields:@{
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to