Skip to content

Conversation

ngrecco
Copy link

@ngrecco ngrecco commented Aug 11, 2021

When running the tests in a browser with a PATCH type request, "PATCH" method is sent in all lower case letters. When the request uses CORS, the preflight OPTIONS is triggered before the actual request. This request is sent with the following header: "Access-Control-Request-Method = patch" instead of "Access-Control-Request-Method = PATCH". This causes the "Access-Control-Allow-Methods = GET, POST, OPTIONS, PUT, PATCH, DELETE" to fail, because the expected method is "PATCH" instead of "patch".
For further reading please refer to this stack overflow post: https://stackoverflow.com/questions/55250297/problem-with-patch-method-and-cors-preflight-request?rq=1

When running the tests in a browser with a PATCH type request, "PATCH" method is sent in all lower case letters. When the request uses CORS, the preflight OPTIONS is triggered before the actual request.  This request is sent with the following header: "Access-Control-Request-Method = patch" instead of "Access-Control-Request-Method = PATCH". This causes the "Access-Control-Allow-Methods = GET, POST, OPTIONS, PUT, PATCH, DELETE" to fail, because the expected method is "PATH" instead of "path". 
For further reading please refer to this stack overflow post: https://stackoverflow.com/questions/55250297/problem-with-patch-method-and-cors-preflight-request?rq=1
@ngrecco
Copy link
Author

ngrecco commented Aug 11, 2021

Here you can see the issue replicated with Swagger generated server: swagger-api/swagger-ui#809

Copy link
Author

@ngrecco ngrecco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed typo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant