Changeset 263537 in webkit


Ignore:
Timestamp:
Jun 25, 2020 3:39:22 PM (4 years ago)
Author:
jer.noble@apple.com
Message:

iOS Safari incorrectly reports "AppleCoreMedia" as UA string
https://bugs.webkit.org/show_bug.cgi?id=213245
<rdar://problem/64471582>

Reviewed by Youenn Fablet.

Source/WebCore:

Tests: TestWebKitAPI.MediaLoading.UserAgentStringCRABS

TestWebKitAPI.MediaLoading.UserAgentStringHLS

  • platform/network/cocoa/WebCoreNSURLSession.mm:

(-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):

Tools:

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm: Added.

(TestWebKitAPI::parseUserAgent):
(TestWebKitAPI::TEST):

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r263535 r263537  
     12020-06-25  Jer Noble  <jer.noble@apple.com>
     2
     3        iOS Safari incorrectly reports "AppleCoreMedia" as UA string
     4        https://bugs.webkit.org/show_bug.cgi?id=213245
     5        <rdar://problem/64471582>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Tests: TestWebKitAPI.MediaLoading.UserAgentStringCRABS
     10               TestWebKitAPI.MediaLoading.UserAgentStringHLS
     11
     12        * platform/network/cocoa/WebCoreNSURLSession.mm:
     13        (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
     14
    1152020-06-25  Megan Gardner  <megan_gardner@apple.com>
    216
  • trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm

    r262131 r263537  
    658658    self.state = NSURLSessionTaskStateSuspended;
    659659    self.priority = NSURLSessionTaskPriorityDefault;
     660
     661    // CoreMedia will explicitly add a user agent header. Remove if present.
     662    if (auto* userAgentValue = [request valueForHTTPHeaderField:@"User-Agent"]) {
     663        NSMutableURLRequest* mutableRequest = [request mutableCopyWithZone:nil];
     664        [mutableRequest setValue:nil forHTTPHeaderField:@"User-Agent"];
     665        request = [mutableRequest autorelease];
     666    }
     667
    660668    self.originalRequest = self.currentRequest = request;
    661669
  • trunk/Tools/ChangeLog

    r263531 r263537  
     12020-06-25  Jer Noble  <jer.noble@apple.com>
     2
     3        iOS Safari incorrectly reports "AppleCoreMedia" as UA string
     4        https://bugs.webkit.org/show_bug.cgi?id=213245
     5        <rdar://problem/64471582>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     10        * TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm: Added.
     11        (TestWebKitAPI::parseUserAgent):
     12        (TestWebKitAPI::TEST):
     13
    1142020-06-25  Daniel Bates  <dabates@apple.com>
    215
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r263529 r263537  
    958958                CAB0FF5322332407006CA5B0 /* IndexedDBFileName-2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CAB0FF50223323F6006CA5B0 /* IndexedDBFileName-2.html */; };
    959959                CAB0FF5522332C57006CA5B0 /* IndexedDBFileName.mm in Sources */ = {isa = PBXBuildFile; fileRef = CAB0FF5422332C3A006CA5B0 /* IndexedDBFileName.mm */; };
     960                CD0370E324A44D9600BA3CAE /* MediaLoading.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD0370E224A44B7A00BA3CAE /* MediaLoading.mm */; };
    960961                CD0BD0A61F79924D001AB2CF /* ContextMenuImgWithVideo.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD0BD0A51F799220001AB2CF /* ContextMenuImgWithVideo.mm */; };
    961962                CD0BD0A81F79982D001AB2CF /* ContextMenuImgWithVideo.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD0BD0A71F7997C2001AB2CF /* ContextMenuImgWithVideo.html */; };
     
    26052606                CAB0FF51223323F6006CA5B0 /* IndexedDBFileName-1.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "IndexedDBFileName-1.html"; sourceTree = "<group>"; };
    26062607                CAB0FF5422332C3A006CA5B0 /* IndexedDBFileName.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IndexedDBFileName.mm; sourceTree = "<group>"; };
     2608                CD0370E224A44B7A00BA3CAE /* MediaLoading.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaLoading.mm; sourceTree = "<group>"; };
    26072609                CD0BD0A51F799220001AB2CF /* ContextMenuImgWithVideo.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ContextMenuImgWithVideo.mm; sourceTree = "<group>"; };
    26082610                CD0BD0A71F7997C2001AB2CF /* ContextMenuImgWithVideo.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = ContextMenuImgWithVideo.html; sourceTree = "<group>"; };
     
    31763178                                7A6A2C6F1DCCF87B00C0D085 /* LocalStorageQuirkTest.mm */,
    31773179                                07CC7DFD2266330800E39181 /* MediaBufferingPolicy.mm */,
     3180                                CD0370E224A44B7A00BA3CAE /* MediaLoading.mm */,
    31783181                                51BE9E652376089500B4E117 /* MediaType.mm */,
    31793182                                5165FE03201EE617009F7EC3 /* MessagePortProviders.mm */,
     
    48734876                                7CCE7EB51A411A7E00447C4C /* BackForwardList.mm in Sources */,
    48744877                                1C7FEB20207C0F2E00D23278 /* BackgroundColor.mm in Sources */,
     4878                                CD0370E324A44D9600BA3CAE /* MediaLoading.mm in Sources */,
    48754879                                C15CBB3023F1FF1A00300CC7 /* BacklightLevelNotification.mm in Sources */,
    48764880                                C1692DCA23D10DAE006E88F7 /* Battery.mm in Sources */,
Note: See TracChangeset for help on using the changeset viewer.