fix: OPTIONS not accepting all available media

This commit is contained in:
steve-chavez
2023-06-13 22:00:21 -05:00
committed by Steve Chavez
parent 11a9849152
commit fad47324c3
3 changed files with 21 additions and 3 deletions
+4
View File
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## Unreleased
### Fixed
- #2821, Fix OPTIONS not accepting all available media types - @steve-chavez
## [11.1.0] - 2023-06-07
### Added
+2 -2
View File
@@ -375,8 +375,8 @@ requestMediaTypes conf action path =
ActionRead _ -> defaultMediaTypes ++ rawMediaTypes
ActionInvoke _ -> invokeMediaTypes
ActionInspect _ -> [MTOpenAPI, MTApplicationJSON]
ActionInfo -> [MTTextCSV]
_ -> defaultMediaTypes
ActionInfo -> defaultMediaTypes
ActionMutate _ -> defaultMediaTypes
where
invokeMediaTypes =
defaultMediaTypes
+15 -1
View File
@@ -40,7 +40,7 @@ spec =
\Date, Location, Server, Transfer-Encoding, Range-Unit"]
}
it "allows INFO body through even with CORS request headers present to postflight request" $
it "allows INFO body through even with CORS request headers present to postflight request" $ do
request methodOptions "/items"
[ ("Host", "localhost:3000")
, ("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0")
@@ -54,3 +54,17 @@ spec =
`shouldRespondWith`
""
{ matchHeaders = [ "Access-Control-Allow-Origin" <:> "*" ] }
request methodOptions "/items"
[ ("Accept", "application/json") ]
""
`shouldRespondWith`
""
{ matchHeaders = [ "Access-Control-Allow-Origin" <:> "*" ] }
request methodOptions "/shops"
[ ("Accept", "application/geo+json") ]
""
`shouldRespondWith`
""
{ matchHeaders = [ "Access-Control-Allow-Origin" <:> "*" ] }