fix: OPTIONS not accepting all available media
This commit is contained in:
committed by
Steve Chavez
parent
11a9849152
commit
fad47324c3
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- #2821, Fix OPTIONS not accepting all available media types - @steve-chavez
|
||||||
|
|
||||||
## [11.1.0] - 2023-06-07
|
## [11.1.0] - 2023-06-07
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -375,8 +375,8 @@ requestMediaTypes conf action path =
|
|||||||
ActionRead _ -> defaultMediaTypes ++ rawMediaTypes
|
ActionRead _ -> defaultMediaTypes ++ rawMediaTypes
|
||||||
ActionInvoke _ -> invokeMediaTypes
|
ActionInvoke _ -> invokeMediaTypes
|
||||||
ActionInspect _ -> [MTOpenAPI, MTApplicationJSON]
|
ActionInspect _ -> [MTOpenAPI, MTApplicationJSON]
|
||||||
ActionInfo -> [MTTextCSV]
|
ActionInfo -> defaultMediaTypes
|
||||||
_ -> defaultMediaTypes
|
ActionMutate _ -> defaultMediaTypes
|
||||||
where
|
where
|
||||||
invokeMediaTypes =
|
invokeMediaTypes =
|
||||||
defaultMediaTypes
|
defaultMediaTypes
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ spec =
|
|||||||
\Date, Location, Server, Transfer-Encoding, Range-Unit"]
|
\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"
|
request methodOptions "/items"
|
||||||
[ ("Host", "localhost:3000")
|
[ ("Host", "localhost:3000")
|
||||||
, ("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0")
|
, ("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`
|
`shouldRespondWith`
|
||||||
""
|
""
|
||||||
{ matchHeaders = [ "Access-Control-Allow-Origin" <:> "*" ] }
|
{ 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" <:> "*" ] }
|
||||||
|
|||||||
Reference in New Issue
Block a user