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

vite模式下,proxy接口返回html #365

Open
berwin0415 opened this issue Dec 19, 2024 · 2 comments
Open

vite模式下,proxy接口返回html #365

berwin0415 opened this issue Dec 19, 2024 · 2 comments

Comments

@berwin0415
Copy link

vite模式下,proxy接口返回html

问题描述

配置代理proxy, 期望/api开头请求走代理,但是返回html

请求模拟脚本,Accept较多是复制的浏览器请求

image

config仅修改proxy
image

脚本响应
image

期望

正常响应代理内容

复现仓库

https://github.com/berwin0415/reskript/tree/vite-proxy

vite-proxy 分支showcase/todo内

target-api.sh为模拟请求脚本

@otakustay
Copy link
Member

你直接用devServer的代理相关的配置,是否也存在一样的问题?https://reskript.dev/docs/settings/dev-server#%E9%85%8D%E7%BD%AE%E4%BB%A3%E7%90%86%E8%B7%AF%E5%BE%84

@berwin0415
Copy link
Author

你直接用devServer的代理相关的配置,是否也存在一样的问题?https://reskript.dev/docs/settings/dev-server#%E9%85%8D%E7%BD%AE%E4%BB%A3%E7%90%86%E8%B7%AF%E5%BE%84

一样存在

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

No branches or pull requests

2 participants