⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 263880 in webkit


Ignore:
Timestamp:
Jul 2, 2020, 8:19:55 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

MIMETypeRegistry::getExtensionsForMIMEType() needs to handle wildcard MIME types
https://bugs.webkit.org/show_bug.cgi?id=213826

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-07-02
Reviewed by Darin Adler.

Addressing post commit review comments for r263832.

  • platform/cocoa/MIMETypeRegistryCocoa.mm:

(WebCore::extensionsForMIMETypeMap):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r263878 r263880  
     12020-07-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        MIMETypeRegistry::getExtensionsForMIMEType() needs to handle wildcard MIME types
     4        https://bugs.webkit.org/show_bug.cgi?id=213826
     5
     6        Reviewed by Darin Adler.
     7
     8        Addressing post commit review comments for r263832.
     9
     10        * platform/cocoa/MIMETypeRegistryCocoa.mm:
     11        (WebCore::extensionsForMIMETypeMap):
     12
    1132020-07-02  Brady Eidson  <beidson@apple.com>
    214
  • trunk/Source/WebCore/platform/cocoa/MIMETypeRegistryCocoa.mm

    r263832 r263880  
    4747
    4848            ASSERT(pos != notFound);
    49             auto wildcardMIMEType = makeString(type.left(pos), "/*"_s);
     49            auto wildcardMIMEType = makeString(StringView(type).left(pos), "/*"_s);
    5050
    5151            for (NSString *extension in extensions) {
    52                 if (!extension)
    53                     continue;
    54 
    5552                // Add extension to wildcardMIMEType, for example add "png" to "image/*"
    5653                addExtension(wildcardMIMEType, extension);
     
    6057        };
    6158
    62         auto allUTIs = adoptNS((__bridge NSArray<NSString *> *)_UTCopyDeclaredTypeIdentifiers());
     59        auto allUTIs = adoptCF(_UTCopyDeclaredTypeIdentifiers());
    6360
    64         for (NSString *uti in allUTIs.get()) {
     61        for (NSString *uti in (__bridge NSArray<NSString *> *)allUTIs.get()) {
    6562            auto type = adoptCF(UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)uti, kUTTagClassMIMEType));
    6663            if (!type)
Note: See TracChangeset for help on using the changeset viewer.