diff --git a/src/PostgREST/Middleware.hs b/src/PostgREST/Middleware.hs index 15380f534c..aeafe53658 100644 --- a/src/PostgREST/Middleware.hs +++ b/src/PostgREST/Middleware.hs @@ -128,6 +128,8 @@ corsPolicy req = case lookup "origin" headers of headers = Wai.requestHeaders req accHeaders = case lookup "access-control-request-headers" headers of Just hdrs -> map (CI.mk . BS.strip) $ BS.split ',' hdrs + -- Impossible case, Middleware.Cors will not evaluate this when + -- the Access-Control-Request-Headers header is not set. Nothing -> [] -- | Set a transaction to eventually roll back if requested and set respective diff --git a/test/coverage.overlay b/test/coverage.overlay index e69de29bb2..8583637514 100644 --- a/test/coverage.overlay +++ b/test/coverage.overlay @@ -0,0 +1,5 @@ +module "postgrest-9.0.0.20211220-inplace/PostgREST.Middleware" { + inside "corsPolicy" { + tick "[]" on line 133; + } +}