OPTIONS request for route with Header/Body fails with 400
See original GitHub issueTo properly provide for CORS, each endpoint must support OPTIONS
method to prevent CORS preflight channel did not succeed
.
This normally works for endpoints without required Headers
or Body
. OPTIONS
of such endpoints with fail with:
{"message":"Missing/invalid parameters","params":[
{"name":"body","type":"body","datatype":"object","required":true,"reason":"Invalid"}
]}
I believe this is a bug as these parameters should not be required for OPTIONS
method call.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
NET Web API + AngularJS: CORS OPTIONS Request fails ...
NET Web API + AngularJS: CORS OPTIONS Request fails with 400 Bad Request · Ask Question ... In Fiddler, the OPTIONS request looks...
Read more >Error handling — tapir 1.x documentation - SoftwareMill
A 400 Bad Request response is returned if a query parameter, header or body causes any decode failure, or if the decoding a...
Read more >OPTIONS - HTTP - MDN Web Docs
The HTTP OPTIONS method requests permitted communication options for a given URL or server. A client can specify a URL with this method, ......
Read more >curl_getinfo - Manual - PHP
CURLINFO_HEADER_OUT - The request string sent. For this to work, add the CURLINFO_HEADER_OUT option to the handle by calling curl_setopt() ...
Read more >API: Postman HTTP Requests - Dotcom-Monitor
Testing APIs with Postman Explained · Adding a new HTTP request using the Postman interface. · Customizing the request (specifying an HTTP method,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like the PreFlightExtractionFilter isn’t ignoring the post requests. For the moment you can define your own one and add it at the contract level.
https://github.com/http4k/http4k/blob/master/http4k-contract/src/main/kotlin/org/http4k/contract/PreFlightExtraction.kt
superb!