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