Skip to content

Duplicated values when passing uppercase values for headers #100

@mrctrifork

Description

@mrctrifork

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

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