nise/nise-frontend/src/corelib/nise-http.interceptor.ts

18 lines
503 B
TypeScript
Raw Normal View History

import {Injectable} from '@angular/core';
import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';
import {Observable} from 'rxjs';
@Injectable()
export class NiseHttpInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const modifiedReq = req.clone({
headers: req.headers.set('X-NISE-API', '20240218'),
withCredentials: true
});
return next.handle(modifiedReq);
}
}