diff --git a/packages/hoppscotch-common/src/platform/index.ts b/packages/hoppscotch-common/src/platform/index.ts index 2550a5a59..9acff14f4 100644 --- a/packages/hoppscotch-common/src/platform/index.ts +++ b/packages/hoppscotch-common/src/platform/index.ts @@ -54,6 +54,11 @@ export type PlatformDef = { * Whether to show the A/B testing workspace switcher click login flow or not */ workspaceSwitcherLogin?: Ref + + /** + * Whether to show the warning about supported interceptors while using the Digest Authorization type + */ + showInterceptorWarningForDigestAuth?: boolean } limits?: LimitsPlatformDef infra?: InfraPlatformDef diff --git a/packages/hoppscotch-common/src/platform/interceptors.ts b/packages/hoppscotch-common/src/platform/interceptors.ts index 6c2cd8324..9197cf722 100644 --- a/packages/hoppscotch-common/src/platform/interceptors.ts +++ b/packages/hoppscotch-common/src/platform/interceptors.ts @@ -14,4 +14,5 @@ export type PlatformInterceptorDef = export type InterceptorsPlatformDef = { default: string interceptors: PlatformInterceptorDef[] + showInterceptorWarningForDigestAuth?: boolean } diff --git a/packages/hoppscotch-common/src/services/inspection/inspectors/authorization.inspector.ts b/packages/hoppscotch-common/src/services/inspection/inspectors/authorization.inspector.ts index 4a9818abb..e26f251e2 100644 --- a/packages/hoppscotch-common/src/services/inspection/inspectors/authorization.inspector.ts +++ b/packages/hoppscotch-common/src/services/inspection/inspectors/authorization.inspector.ts @@ -75,10 +75,8 @@ export class AuthorizationInspectorService const results: InspectorResult[] = [] // `Agent` interceptor is recommended while using Digest Auth - // TODO: Better check to detect the platform - // Interceptor check only applies to the browser platform const isUnsupportedInterceptor = - platform.interceptors.default === "browser" && + platform.platformFeatureFlags.showInterceptorWarningForDigestAuth && this.interceptorService.currentInterceptorID.value !== this.agentService.interceptorID diff --git a/packages/hoppscotch-selfhost-web/src/main.ts b/packages/hoppscotch-selfhost-web/src/main.ts index 3d5839d4e..4482d4163 100644 --- a/packages/hoppscotch-selfhost-web/src/main.ts +++ b/packages/hoppscotch-selfhost-web/src/main.ts @@ -42,6 +42,7 @@ createHoppApp("#app", { platformFeatureFlags: { exportAsGIST: false, hasTelemetry: false, + showInterceptorWarningForDigestAuth: true, }, limits: { collectionImportSizeLimit: 50,