Commit b56bf1b4 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[CORS] enabling options and /*.

parent a1417def
...@@ -120,14 +120,15 @@ makeApp fw = do ...@@ -120,14 +120,15 @@ makeApp fw = do
False -> resp ( responseLBS status401 [] "Invalid Origin or Host header" ) False -> resp ( responseLBS status401 [] "Invalid Origin or Host header" )
let corsMiddleware = cors $ \_ -> Just CorsResourcePolicy let corsMiddleware = cors $ \_ -> Just CorsResourcePolicy
-- { corsOrigins = Just ([env^.settings.allowedOrigin], False) -- { corsOrigins = Just ([env^.settings.allowedOrigin], False)
{ corsOrigins = Just (["http://localhost:8008"], False) { corsOrigins = Nothing -- == /*
, corsMethods = [methodGet, methodPost, methodPut, methodDelete] , corsMethods = [ methodGet , methodPost , methodPut
, methodDelete, methodOptions, methodHead]
, corsRequestHeaders = ["authorization", "content-type"] , corsRequestHeaders = ["authorization", "content-type"]
, corsExposedHeaders = Nothing , corsExposedHeaders = Nothing
, corsMaxAge = Just ( 60*60*24 ) -- one day , corsMaxAge = Just ( 60*60*24 ) -- one day
, corsVaryOrigin = False , corsVaryOrigin = False
, corsRequireOrigin = True , corsRequireOrigin = False
, corsIgnoreFailures = False , corsIgnoreFailures = False
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment