Skip to content

Allow configure fetch (mode, headers to add credentials, etc) #11

@mastepanoski

Description

@mastepanoski

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I need to allow download links from another domain. I am getting this error: "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource". It can be fixed by passing "mode: no-cors" to fetch.

If the link need any OAuth Token, or Cookie Token, it must allow passing the Authorization Header, and/or HTTP-Only Cookies.

Describe the solution you'd like
A clear and concise description of what you want to happen.

CORS: It can be fixed by passing "mode: no-cors" to fetch. So you could add a "fetchProps" attribute (fetchProps={{ mode: 'no-cors' }}.
Authorization: It can be fixed by passing "authorization: token" to fetch. So you could add a "fetchProps" attribute (fetchProps={{ credentials: 'include', authToken: token }}.

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