Migrate MIME-type lookup to UTType (UniformTypeIdentifiers)
Replace the deprecated CoreServices UTI calls (UTTypeCreatePreferredIdentifierForTag / UTTypeCopyPreferredTagWithClass) in GCDWebServerGetMimeTypeForExtension with the modern [UTType typeWithFilenameExtension:].preferredMIMEType, removing the -Wdeprecated-declarations pragma. Behavior is unchanged: known extensions map to the same MIME type, unknown ones fall back to the default. The UniformTypeIdentifiers framework (macOS 11+ / iOS 14+ / tvOS 14+, within the project's deployment targets) is now linked in all three build systems: Xcode (OTHER_LDFLAGS), CocoaPods (Core subspec frameworks), and SwiftPM (linkedFramework). Verified: Run-Tests.sh, swift build, and pod lib lint all pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -16,6 +16,7 @@ Pod::Spec.new do |s|
|
||||
s.subspec 'Core' do |cs|
|
||||
cs.source_files = 'GCDWebServer/**/*.{h,m}'
|
||||
cs.private_header_files = "GCDWebServer/Core/GCDWebServerPrivate.h"
|
||||
cs.frameworks = 'UniformTypeIdentifiers'
|
||||
cs.ios.library = 'z'
|
||||
cs.ios.frameworks = 'CoreServices', 'CFNetwork'
|
||||
cs.tvos.library = 'z'
|
||||
|
||||
Reference in New Issue
Block a user