cov: Add coverage overlay for impossible case in corsPolicy

This commit is contained in:
Wolfgang Walther
2022-01-05 11:01:54 +01:00
committed by Wolfgang Walther
parent 826ae7459a
commit e13d912a79
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -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
+5
View File
@@ -0,0 +1,5 @@
module "postgrest-9.0.0.20211220-inplace/PostgREST.Middleware" {
inside "corsPolicy" {
tick "[]" on line 133;
}
}