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

fix: mock OPTIONS #11829

Closed
wants to merge 1 commit into from
Closed

fix: mock OPTIONS #11829

wants to merge 1 commit into from

Conversation

xuemengfei
Copy link

The cors middleware intercepted all OPTIONS requests, causing the business mock OPTIONS interfaces to not take effect.

The issue was resolved by placing the cors middleware after the business middlewares.

Copy link

vercel bot commented Nov 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
umi ⬜️ Ignored (Inspect) Visit Preview Nov 3, 2023 0:35am

Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (553711a) 29.02% compared to head (0082391) 29.02%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #11829   +/-   ##
=======================================
  Coverage   29.02%   29.02%           
=======================================
  Files         488      488           
  Lines       14829    14829           
  Branches     3513     3513           
=======================================
  Hits         4304     4304           
  Misses       9765     9765           
  Partials      760      760           
Files Coverage Δ
packages/bundler-webpack/src/server/server.ts 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fz6m
Copy link
Contributor

fz6m commented Nov 3, 2023

qiankun 的 CI 挂了,另外这里把 cors 移到后面会导致用户的 onBeforeMiddlewareaddBeforeMiddleware 都没有 cors 了,由于我们没法确定用户的行为,比如代理等,可能全都挂了,属于 Breaking change ,我认为移动 cors 位置不是一个好的解决方法,这种少数的情况把 options 请求都 mock 到其他服务比较好吧,再起一个小的 mock 服务。

@xuemengfei
Copy link
Author

qiankun 的 CI 挂了,另外这里把 cors 移到后面会导致用户的 onBeforeMiddlewareaddBeforeMiddleware 都没有 cors 了,由于我们没法确定用户的行为,比如代理等,可能全都挂了,属于 Breaking change ,我认为移动 cors 位置不是一个好的解决方法,这种少数的情况把 options 请求都 mock 到其他服务比较好吧,再起一个小的 mock 服务。

嗯嗯,之前没考虑到对前面的影响,我再想想其他方案

@xuemengfei xuemengfei closed this Nov 3, 2023
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.

2 participants