Add condiction if withCredentials in order to add cookie in the request.
This commit is contained in:
parent
789a0225fa
commit
e0c45b1065
|
@ -36,7 +36,9 @@ export class HttpInterceptorService implements HttpInterceptor {
|
|||
} else {
|
||||
if (isPlatformServer(this.platformId)) {
|
||||
let headers = new HttpHeaders();
|
||||
headers = headers.set('Cookie', this.req.get('Cookie'));
|
||||
if(request.withCredentials) {
|
||||
headers = headers.set('Cookie', this.req.get('Cookie'));
|
||||
}
|
||||
const authReq = request.clone({
|
||||
headers: headers
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue