synapsestudios / fetch-client

http client library based on fetch
MIT License
9 stars 3 forks source link

oauth plugin: When retrying a request that failed due to a 401 headers are concatenated together #102

Closed spruce-bruce closed 5 years ago

spruce-bruce commented 5 years ago

After a request fails due to a 401 we do a token exchange and attempt the same request again with the new token.

Instead of replacing the old token, we're appending a new Bearer ${xyz} string onto the end of the old Authorization header.

In addition, any headers added by other plugins are also concatenated together.