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

Http OPTIONS request doesn't work with Server Proxy #17525

Closed
7 tasks done
mannukalra opened this issue Jun 19, 2024 · 3 comments
Closed
7 tasks done

Http OPTIONS request doesn't work with Server Proxy #17525

mannukalra opened this issue Jun 19, 2024 · 3 comments

Comments

@mannukalra
Copy link

mannukalra commented Jun 19, 2024

Describe the bug

For react-ts template OPTIONS (HTTP method) request doesn't get forwarded to the proxy back-end port, always receives a 204 No Content response.
Is it possible that options call isn't implemented.

Have tried going through node-http-proxy , couldn't find any way to specify the supported HTTP methods.

image

Reproduction

https://stackblitz.com/edit/vitejs-vite-ez3e1e?file=vite.config.ts,main.js&terminal=dev

Steps to reproduce

npm create vite --template react-ts
configure the server proxy in vite.config.ts

System Info

Windows 11, Vite 5.2.0, occurs in both Chrome and Firefox.

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented Jun 19, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sapphi-red
Copy link
Member

You can set server.cors: false to disable that behavior.

@mannukalra
Copy link
Author

Thanks @sapphi-red, It worked with the suggestion, if possible please have it documented.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants