 import HTTP
+
+/// Error thrown during instantiation of the `CORSConfiguration`.
+public enum CORSConfigurationError: Error {
+
+    /// Configuration file could not be found.
+    case configurationFileNotFound
+
+    /// A required key is missing in the configuration file. The associated value is the key name.
+    case missingRequiredConfigurationKey(String)
+}
 
 /// Option for the allow origin header in responses for CORS requests.
 ///


    /// Uses custom string provided as an associated value.
    case custom(String)


    /// Creates the header string depending on the case of self.
    ///

    /// Optionally sets expiration of the cached pre-flight request. Value is in seconds.
    public let cacheExpiration: Int?

    /// Headers exposed in the response of pre-flight request.
    public let exposedHeaders: String?

    /// Instantiate a CORSConfiguration struct that can be used to create a `CORSConfiguration`
    /// middleware for adding support for CORS in your responses.
    ///
    /// - Parameters:
    ///   - allowedOrigin: Setting that controls which origin values are allowed.
    ///   - allowedMethods: Methods that are allowed for a CORS request response.
    ///   - allowedHeaders: Headers that are allowed in a response for CORS request.
    ///   - allowCredentials: If cookies and other credentials will be sent in the response.
    ///   - cacheExpiration: Optionally sets expiration of the cached pre-flight request in seconds.
    ///   - exposedHeaders: Headers exposed in the response of pre-flight request.
    public init(allowedOrigin: AllowOriginSetting,
                allowedMethods: [Method],
                allowedHeaders: [String],
