Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated values when passing uppercase values for headers #100

Open
mrctrifork opened this issue Jun 4, 2024 · 0 comments · May be fixed by #101
Open

Duplicated values when passing uppercase values for headers #100

mrctrifork opened this issue Jun 4, 2024 · 0 comments · May be fixed by #101

Comments

@mrctrifork
Copy link

mrctrifork commented Jun 4, 2024

If you create the client like so:

treaty<App>('http://localhost:4000', {
  onRequest: (path, options) => {
     const token = localStorage.get('token');
    if( token ) {
      return { 
        headers: {
            Authorization: `Bearer ${token}`
        }
      }
    }
  }
})

Ends up sending the request as follows:

GET /
...headers
authorization: Bearer token, Bearer token

If you send the header in lowercase it works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant