Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update request.js #296

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Update request.js #296

wants to merge 2 commits into from

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