C
C#10mo ago
heloo

SignalR sending wont send custom headers

try{ const conn = new HubConnectionBuilder() .withUrl("http://localhost:4000/chat", { accessTokenFactory: () => { console.log(token) return token }, withCredentials: true, headers:{ "test":"test" } }) .configureLogging(LogLevel.Information).build()

await conn.start();
const re = await conn.invoke("CreateChatRoom", "num", id); console.log(re) }catch(e){ console.log(e) } _httpContext.HttpContext.Request.Headers.ToList().ForEach(e => Console.WriteLine(e)); i wont get the custom or auth headers on the server
12 Replies
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
heloo
helooOP10mo ago
?
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
heloo
helooOP10mo ago
i just want to see the all the headers iam getting in the req for debugging purposes and no i dont have a repo its a client issue because when i check the network tab the headers arent getting sent
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
leowest
leowest10mo ago
can u even send custom header after the websocket has been created
heloo
helooOP10mo ago
idk
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
leowest
leowest10mo ago
if it was a simple requesst I would guess you could be its a websocket so I assume u will have to pass those data in a different way maybe?
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
leowest
leowest10mo ago
that is prior having a websocket
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server