Skip to content

Support Auth Headers per Endpoint #98

@SomethingCreativeStudios

Description

Currently there appears to be a way to override the global fetch for every endpoint. However, I do not see a way to edit these headers per endpoint.
I have an ogc endpoint that has basic auth and would like to pass auth headers for that exact endpoint.

I am not sure what the simpler option would be but maybe edit the setFetchOptions to take in a map were each key is an endpoint url and apply fetch based on that.

A very spaghetti code way could be something like

setFetchOptions({ "www.some-endpoint.com": { headers: {"Auth": "Basic username:password"}}});

and then in sharedFetch

Get the keys of getFetchOptions()... and find the matching one based parameter url.

if url.startsWith(key) use those options

...
Or maybe add an options parameter to sharedFetch that is optional and then add that param to every other function that uses sharedFetch directly or indirectly as optional.

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