- .search-res-dialog{
- position: fixed;
- background: white;
- box-shadow: rgba(0, 0, 0, 0.247059) 0px 5px 6px 0px;
- top: 2.5em;
- border-radius: 0.25rem;
- padding: 20px;
- opacity: 1;
- z-index: 1;
- }
- .searchUl {
- list-style: none;
- border-bottom: 1px solid #bbb;
- padding-bottom: 20px;
- padding-left: 4px;
+@Injectable()
+export class HeaderInterceptor implements HttpInterceptor {
+ intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
+ // Clone the request to add the new header
+ // HttpHeader object immutable - copy values
+ const headerSettings: { [name: string]: string | string[]; } = {};
+ headerSettings['X-ECOMP-RequestID'] = uuid();
+ const requestType = req.params.get('requestType');
+
+ if(requestType!=null && requestType==='fileUpload'){
+ //headerSettings['Content-Type'] = 'multipart/form-data';
+ }else if(requestType!=null && requestType==='downloadWidgetFile'){
+ headerSettings['X-Widgets-Type'] = 'all';
+ headerSettings['Content-Type'] = 'application/octet-stream';
+ }else{
+ headerSettings['Content-Type'] = 'application/json';
+ }
+ const newHeader = new HttpHeaders(headerSettings);
+ const clonedRequest = req.clone({ headers: newHeader, withCredentials: true });
+ // Pass the cloned request instead of the original request to the next handle
+ return next.handle(clonedRequest);