|
|
|
@ -10,6 +10,8 @@ export class OpenProjectHeaderInterceptor implements HttpInterceptor { |
|
|
|
|
intercept(req:HttpRequest<any>, next:HttpHandler):Observable<HttpEvent<any>> { |
|
|
|
|
const csrf_token:string|undefined = jQuery('meta[name=csrf-token]').attr('content'); |
|
|
|
|
|
|
|
|
|
if (req.withCredentials !== false) { |
|
|
|
|
|
|
|
|
|
let newHeaders = req.headers |
|
|
|
|
.set('X-Authentication-Scheme', 'Session') |
|
|
|
|
.set('X-Requested-With', 'XMLHttpRequest'); |
|
|
|
@ -27,4 +29,7 @@ export class OpenProjectHeaderInterceptor implements HttpInterceptor { |
|
|
|
|
// Pass the cloned request instead of the original request to the next handle
|
|
|
|
|
return next.handle(clonedRequest); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return next.handle(req); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|