Skip to content

Didn't handle preflight request correctly #4180

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

Closed
TrickyPi opened this issue Jan 14, 2022 · 2 comments · Fixed by #4185 or angular/angular-cli#23725
Closed

Didn't handle preflight request correctly #4180

TrickyPi opened this issue Jan 14, 2022 · 2 comments · Fixed by #4185 or angular/angular-cli#23725

Comments

@TrickyPi
Copy link
Contributor

TrickyPi commented Jan 14, 2022

Bug report

Didn't handle preflight request correctly, if browser send a CORS non simple request to get a static resource.

Actual Behavior

Occur a CORS error.
The specific info:
Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Expected Behavior

Request successful

How Do We Reproduce?

  1. type npx ll-create create react-js bug-reproduce command in terminal
  2. cd bug-reproduce
  3. yarn && yarn start
  4. open google.com in browser, type fetch("http://localhost:{port}/",{headers:{"another-header":"1"}}) in devtool

Please paste the results of npx webpack-cli info here, and mention other relevant information

System:

  • OS: macOS 11.5.2
  • CPU: (8) arm64 Apple M1
  • Memory: 131.83 MB / 8.00 GB

Binaries:

  • Node: 16.13.1 - /usr/local/bin/node
  • Yarn: 1.22.15 - /usr/local/bin/yarn
  • npm: 8.1.2 - /usr/local/bin/npm

Browsers:

  • Chrome: 97.0.4692.71
  • Safari: 14.1.2

Other relevant information

  • webpack version: "5.66.0"
  • webpack-dev-sever version:"4.7.3"
@alexander-akait
Copy link
Member

PR welome

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 27, 2022
…quests

With this commit, we add a middleware that handles preflight requests as currently responses for this type of requests returning 404.

This is a temporary workaround until this issue is fixed upstream. See: webpack/webpack-dev-server#4180

Closes angular#23639
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 27, 2022
…quests

With this commit, we add a middleware that handles preflight requests as currently responses for this type of requests returning 404.

This is a temporary workaround until this issue is fixed upstream. See: webpack/webpack-dev-server#4180

Closes angular#23639
@nickdeakin
Copy link

Alans change fixes this issue

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Aug 2, 2022
…quests

With this commit, we add a middleware that handles preflight requests as currently responses for this type of requests returning 404.

This is a temporary workaround until this issue is fixed upstream. See: webpack/webpack-dev-server#4180

Closes angular#23639
dgp1130 pushed a commit to angular/angular-cli that referenced this issue Aug 2, 2022
…quests

With this commit, we add a middleware that handles preflight requests as currently responses for this type of requests returning 404.

This is a temporary workaround until this issue is fixed upstream. See: webpack/webpack-dev-server#4180

Closes #23639
dgp1130 pushed a commit to angular/angular-cli that referenced this issue Aug 2, 2022
…quests

With this commit, we add a middleware that handles preflight requests as currently responses for this type of requests returning 404.

This is a temporary workaround until this issue is fixed upstream. See: webpack/webpack-dev-server#4180

Closes #23639

(cherry picked from commit b4a1b0f)
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Aug 11, 2022
… options requests

The upstream fix webpack/webpack-dev-server#4180 has been merged and released as part of `webpack-dev-server` version `4.10.0`
clydin pushed a commit to angular/angular-cli that referenced this issue Aug 11, 2022
… options requests

The upstream fix webpack/webpack-dev-server#4180 has been merged and released as part of `webpack-dev-server` version `4.10.0`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants