From 1014e7b4c0c5ad24d25b549fef43d4fc9fdea2ea Mon Sep 17 00:00:00 2001 From: Dafnik Date: Mon, 30 Oct 2023 11:06:00 +0100 Subject: [PATCH] feat: allow custom HttpContextToken in ByPassInterceptorBuilder --- .../interceptor/by-pass-interceptor.builder.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libs/dfx-helper/src/lib/interceptor/by-pass-interceptor.builder.ts b/libs/dfx-helper/src/lib/interceptor/by-pass-interceptor.builder.ts index 8eb0f67b..96a2185e 100644 --- a/libs/dfx-helper/src/lib/interceptor/by-pass-interceptor.builder.ts +++ b/libs/dfx-helper/src/lib/interceptor/by-pass-interceptor.builder.ts @@ -1,6 +1,10 @@ -import {HttpContext, HttpContextToken} from '@angular/common/http'; -import {BASE_URL_INTERCEPTOR, LOGGING_INTERCEPTOR, POST_PUT_JSON_CONTENT_TYPE_INTERCEPTOR} from './http-context-token'; -import {IBuilder} from 'dfts-helper'; +import { HttpContext, HttpContextToken } from "@angular/common/http"; +import { + BASE_URL_INTERCEPTOR, + LOGGING_INTERCEPTOR, + POST_PUT_JSON_CONTENT_TYPE_INTERCEPTOR +} from "./http-context-token"; +import { IBuilder } from "dfts-helper"; export const interceptorByPass = (context?: HttpContext): ByPassInterceptorBuilder => { return new ByPassInterceptorBuilder().context(context); @@ -29,6 +33,11 @@ export class ByPassInterceptorBuilder implements IBuilder { return this; } + custom(token: HttpContextToken): this { + this.tokens.push(token); + return this; + } + context(context?: HttpContext): this { this._context = context; return this;