Skip to content

Didn't handle preflight request correctly #4180

Closed
angular/angular-cli
#23725
@TrickyPi

Description

@TrickyPi

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions