π Bug report
Command (mark with an x)
Is this a regression?
no
Yes, the previous version in which this bug was not present was: I don't know
Description
I have set up a HttpClient get call and I am setting a http headers. But the wrong http headers information is set (or overwritten) by the information which is set in the sockjs-node.
My get call in the service looks like this:
getUsers(): Observable<IUser[]> {
const url = `${this.backendApiUrl}/api/users`;
const token = this.authService.getTokenFromLocalStorage();
console.log('####-user-service', token);
return this.http.get<IUser[]>(url, {
headers: new HttpHeaders().set('authtoken', token),
});
}
The token property from local storage is the correct token but the sockjs-node call has a different token and that is applied to my HttpHeader.
π¬ Minimal Reproduction
If you have in the sockjs-node info call the same request header set, this will be transferred to the set Headers in backend call.
π₯ Exception or Error
not authorized because wrong auth token is provided
π Your Environment
Angular CLI: 9.0.2
Node: 12.16.2
OS: darwin x64
Angular: 9.0.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.900.2
@angular-devkit/build-angular 0.900.2
@angular-devkit/build-optimizer 0.900.2
@angular-devkit/build-webpack 0.900.2
@angular-devkit/core 9.0.2
@angular-devkit/schematics 9.0.2
@angular/cdk 9.2.4
@angular/cli 9.0.2
@angular/fire 6.0.0
@angular/flex-layout 9.0.0-beta.31
@angular/material 9.2.4
@ngtools/webpack 9.0.2
@schematics/angular 9.0.2
@schematics/update 0.900.2
rxjs 6.5.4
typescript 3.7.5
webpack 4.41.2
Anything else relevant?
no
π Bug report
Command (mark with an
x)Is this a regression?
no
Yes, the previous version in which this bug was not present was: I don't know
Description
I have set up a HttpClient get call and I am setting a http headers. But the wrong http headers information is set (or overwritten) by the information which is set in the sockjs-node.
My get call in the service looks like this:
The token property from local storage is the correct token but the sockjs-node call has a different token and that is applied to my HttpHeader.
π¬ Minimal Reproduction
If you have in the sockjs-node info call the same request header set, this will be transferred to the set Headers in backend call.
π₯ Exception or Error
not authorized because wrong auth token is provided
π Your Environment
Anything else relevant?
no