Skip to content

[Bug]: CORS on private network ( fetch to localhost url fails due to CORS ) #36445

Closed as not planned

Description

@dheerajkysetti

Preflight Checklist

Electron Version

21.3.0

What operating system are you using?

macOS

Operating System Version

macOS M1 Monterey 12.6

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

19.0.13

Expected Behavior

From a website served via https, an javascript fetch to http://localhost:8080 call should be successful.

Actual Behavior

Unable to access localhost URLs(http://localhost:8080) from a website(https://example.com)
Despite turning off websecurity, allowing insecure content.

image

Testcase Gist URL

https://gist.github.com/dheerajkysetti/ae620986fcdd68e18d1d713cc05b0a4a

Additional Information

The http://localhost URL call should be successful from a website served over https
or have an flag/switch to enable disable it
or have intercepts via which such an access can be controlled programatically.
Adding headers(Access-Control-Allow-Private-Network:true) in onBeforeHeadersReceived

Activity

  1. miniak commented on Nov 25, 2022

    @miniak
    Contributor

    please add a proper title

  2. changed the title [-][Bug]: [/-] [+][Bug]: CORS on private network ( fetch to localhost url fails due to CORS )[/+] on Nov 25, 2022
  3. dheerajkysetti commented on Nov 25, 2022

    @dheerajkysetti
    Author

    please add a proper title

    I have updated the title.

  4. MarshallOfSound commented on Nov 27, 2022

    @MarshallOfSound
    Member

    Duplicate #33133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions