Skip to content

feat: OPTIONS request return success code#2867

Merged
chenjiahan merged 1 commit intoweb-infra-dev:v0.xfrom
ji2k:v0.x
Jul 11, 2024
Merged

feat: OPTIONS request return success code#2867
chenjiahan merged 1 commit intoweb-infra-dev:v0.xfrom
ji2k:v0.x

Conversation

@ji2k
Copy link
Copy Markdown
Contributor

@ji2k ji2k 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
Copy Markdown

CLAassistant commented Jul 10, 2024

CLA assistant check
All committers have signed the CLA.

@chenjiahan
Copy link
Copy Markdown
Member

Hi, can you provide more context for this change?

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

ji2k 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
Copy Markdown
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.

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