Closed lucio-c closed 8 years ago
This error occurs when trying to add headers as an object to the connection query string eg: connection.qs = { 'Bearer' : token }; connection.start()...
If you send the headers as a serialised string it works alright
Sry for late response. Do you guys have any idea how to fix this? I can take a look this coming week, but I would want a bit more code that will reproduce the issue.
In my case I ended up not needing the query strings so I'm afraid I don't have a fix..
Ah. Ok. Then, if it's okay with you I'll close this for now. If more people report or have this issue we can open it again.
I've encountered the same scenario, needed the .qs
for authentication to work on signalr hubs. Ended up adding the following code to my own project in order to polyfill jQuery.param
. This only supports very basic objects no nested objects
jQuery.param = (obj) => {
const str = [];
for (const p in obj) {
if (obj.hasOwnProperty(p)) {
str.push(
`${encodeURIComponent(p)}=${encodeURIComponent(obj[p])}`
);
}
}
return str.join('&');
};
@cuixiaolu Please give some more information regarding this. Preferably submit a PR.