Created
January 30, 2018 01:51
-
-
Save d108/dc3f35fd619f2e817db9f4ed671fc635 to your computer and use it in GitHub Desktop.
ResourceTypeDetector.swift code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
} | |
// MARK: Synchronous detectors | |
open class ResourceTypeDetector: NSObject { | |
/// There is not very much of them nor big variety in them, so replacing with | |
/// regexes or adding leading dot in initialization would make the code | |
/// unnecessarily complicated. | |
fileprivate struct TypeMatcherDefinition { | |
var resourceType: WebRequestResourceType // enum reflecting (but not copying) Chrome defined type strings | |
var mimeStrings: [String] // substrings matched against request header "Accept" | |
var fileSuffixes: [String] // URL string suffix match. Complete strings with leading dot. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment