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

feat: OPTIONS request return success code #2867

Merged
merged 1 commit into from
Jul 11, 2024
Merged

feat: OPTIONS request return success code #2867

merged 1 commit into from
Jul 11, 2024

Conversation

vtv6
Copy link
Contributor

@vtv6 vtv6 commented Jul 10, 2024

Summary

Support returning success code in OPTIONS requests.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@CLAassistant
Copy link

CLAassistant commented Jul 10, 2024

CLA assistant check
All committers have signed the CLA.

@chenjiahan
Copy link
Member

Hi, can you provide more context for this change?

@vtv6 vtv6 closed this Jul 10, 2024
@vtv6 vtv6 reopened this Jul 10, 2024
@vtv6
Copy link
Contributor Author

vtv6 commented Jul 10, 2024

I'm integrating with Module Federation v2. Every time the shell app requests the mf-manifest.json file, an OPTIONS request is made to check CORS. However, the OPTIONS request always returns a 404 error, causing the CORS check to fail. Therefore, I referred to webpack-dev-server to create this MR

@chenjiahan chenjiahan changed the base branch from v0.x to main July 11, 2024 13:25
@chenjiahan chenjiahan changed the base branch from main to v0.x July 11, 2024 13:25
@chenjiahan
Copy link
Member

Thanks for the explanation, I have found the related PR from webpack-dev-server: webpack/webpack-dev-server#4559

I will merge this PR and make some changes:

  • Check-pick the commit to main branch, because we have no plan to release 0.x version for new features at present.
  • Change the status code from 200 to 204, because server does not response any data.
  • Move the middleware to the last as a fallback.

@chenjiahan chenjiahan merged commit c98b9d0 into web-infra-dev:v0.x Jul 11, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants