Skip to content

Getting local files (file://) fail after upgrading from 0.18.0 to 0.19.0 #2416

@tobias-rahm

Description

@tobias-rahm

Describe the bug
When using axios to get a local file (file://...) I get status code 0 as if there's a CORS issue. This didn't happen using version 0.18.0 so I assume that this is a bug?

To Reproduce
Get a local file. In my case I wanted to get a PDF as an array buffer.

axios("file://...", {
    responseType: 'arraybuffer'
    headers: {
        Accept: 'application/pdf'
    }
}).then(..)

Expected behavior
Just like in version 0.18.0 version I should get a 200 response.

Environment:

  • Axios Version 0.19.0
  • OS: Windows 10
  • Browser: EO Webbrowser (Chromium)
  • Browser Version: 19.1.95 (Chromium ~70)
  • Additional Library Versions: React 16.8.6

Additional context/Screenshots
Need to build and run index.html locally so you're making the request from file:// as well.

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