The headers variable initialization method is not correct. In the case of multiple threads, headersr of multiple instances points to the same memory address, causing tokens to overwrite each other #72
Describe the bug
In the HubConnectionBuilder, AuthHubConnection, BaseHubConnection and other three classes, the way to initialize the headers variable is:
headers={}
It is normal to use in a single thread, but when used in multiple threads, all headers point to the same memory address, which will cause the token to be overwritten by the last object.
// Comparison of the two initialization methods of the dictionary
// {}
print(id({}))
print(id({}))
print(id({}))
// dict()
print(id(dict()))
print(id(dict()))
print(id(dict()))
/* Post run output
1984312275072
1984312275072
1984312275072
1984315991552
1984315990848
1984316002560
*/
Describe the bug In the HubConnectionBuilder, AuthHubConnection, BaseHubConnection and other three classes, the way to initialize the headers variable is: headers={}
It is normal to use in a single thread, but when used in multiple threads, all headers point to the same memory address, which will cause the token to be overwritten by the last object.