react-native-signalr icon indicating copy to clipboard operation
react-native-signalr copied to clipboard

Cannot add authorization header

Open tmdude9586 opened this issue 7 years ago • 3 comments

I'm trying to connect to my hub, however it requires an Authorization header to be present. I'm looking through the code and documentation, and I cannot find anyway to add said header to the XMLHttpRequest that gets sent.

Due to this I get 401s during the connection. Is there any way to add headers currently?

tmdude9586 avatar Jul 06 '17 14:07 tmdude9586

Looking source code i have found that: image I think passing headers should be like signalr.hubConnection(host, { headers: myHeaders })

xahon avatar Aug 20 '17 16:08 xahon

Looks like my guess is not working

xahon avatar Aug 24 '17 15:08 xahon

I just used query string to pass my headers in url. Passing qs instead of headers in my prior message as object will throw an error. I've created PR that fix that

xahon avatar Aug 25 '17 14:08 xahon