allow options, capital Authorization.
This commit is contained in:
committed by
Joe Nelson
parent
0067f60316
commit
dac9f02578
+2
-2
@@ -35,14 +35,14 @@ argParser = AppConfig
|
|||||||
|
|
||||||
defaultCorsPolicy :: CorsResourcePolicy
|
defaultCorsPolicy :: CorsResourcePolicy
|
||||||
defaultCorsPolicy = CorsResourcePolicy Nothing
|
defaultCorsPolicy = CorsResourcePolicy Nothing
|
||||||
["GET", "POST", "PUT", "PATCH", "DELETE"] ["authorization"] Nothing
|
["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"] ["Authorization"] Nothing
|
||||||
(Just $ 60*60*24) False False True
|
(Just $ 60*60*24) False False True
|
||||||
|
|
||||||
corsPolicy :: Request -> Maybe CorsResourcePolicy
|
corsPolicy :: Request -> Maybe CorsResourcePolicy
|
||||||
corsPolicy req = case lookup "origin" headers of
|
corsPolicy req = case lookup "origin" headers of
|
||||||
Just origin -> Just defaultCorsPolicy {
|
Just origin -> Just defaultCorsPolicy {
|
||||||
corsOrigins = Just ([origin], True),
|
corsOrigins = Just ([origin], True),
|
||||||
corsRequestHeaders = "authentication":accHeaders
|
corsRequestHeaders = "Authentication":accHeaders
|
||||||
}
|
}
|
||||||
Nothing -> Nothing
|
Nothing -> Nothing
|
||||||
where
|
where
|
||||||
|
|||||||
Reference in New Issue
Block a user