[webkit-reviews] review granted: [Bug 213245] iOS Safari incorrectly reports "AppleCoreMedia" as UA string : [Attachment 402718] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 25 00:38:22 PDT 2020


youenn fablet <youennf at gmail.com> has granted Jer Noble <jer.noble at apple.com>'s
request for review:
Bug 213245: iOS Safari incorrectly reports "AppleCoreMedia" as UA string
https://bugs.webkit.org/show_bug.cgi?id=213245

Attachment 402718: Patch

https://bugs.webkit.org/attachment.cgi?id=402718&action=review




--- Comment #7 from youenn fablet <youennf at gmail.com> ---
Comment on attachment 402718
  --> https://bugs.webkit.org/attachment.cgi?id=402718
Patch

LGTM.
In theory, CoreMedia should probably split their code so that they only set
these headers (user-agent, accept...) in the code that actually sends the
requests themselves.

View in context: https://bugs.webkit.org/attachment.cgi?id=402718&action=review

> Tools/TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm:38
> +static String parseUserAgent(Vector<char>&& request)

const Vector<char>&

> Tools/TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm:40
> +    Vector<String> headers = String::fromUTF8(request.data(),
request.size()).split("\r\n");

auto

> Tools/TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm:41
> +    auto index = headers.findMatching([] (const String& header) { return
header.startsWith("User-Agent:"); });

auto

> Tools/TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm:57
> +	   connection.receiveHTTPRequest([&] (Vector<char>&& request) {

auto&&

> Tools/TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm:58
> +	       auto userAgent = parseUserAgent(WTFMove(request));

no need to move. Ditto below.


More information about the webkit-reviews mailing list