From 5f1fc068be3fdefe7d37ab94fd04d511e8df69c4 Mon Sep 17 00:00:00 2001 From: Chris Breederveld Date: Mon, 8 Apr 2024 16:18:24 +0200 Subject: [PATCH] Allow additional headers --- src/MiniProfiler.Shared/ui/lib/MiniProfiler.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/MiniProfiler.Shared/ui/lib/MiniProfiler.ts diff --git a/src/MiniProfiler.Shared/ui/lib/MiniProfiler.ts b/src/MiniProfiler.Shared/ui/lib/MiniProfiler.ts old mode 100644 new mode 100755 index 0e06984f..bd5837db --- a/src/MiniProfiler.Shared/ui/lib/MiniProfiler.ts +++ b/src/MiniProfiler.Shared/ui/lib/MiniProfiler.ts @@ -122,6 +122,7 @@ namespace StackExchange.Profiling { toggleShortcut: string; trivialMilliseconds: number; version: string; + additionalHeaders: object; } enum RenderMode { @@ -302,6 +303,7 @@ namespace StackExchange.Profiling { startHidden: bool(data.startHidden), ignoredDuplicateExecuteTypes: (data.ignoredDuplicateExecuteTypes || '').split(','), nonce: script.nonce, + additionalHeaders: {}, }; function doInit() { @@ -465,8 +467,9 @@ namespace StackExchange.Profiling { method: 'POST', body: JSON.stringify(request), headers: { + ...(this.options.additionalHeaders ?? {}), 'Accept': 'application/json', - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', } }) .then(data => data.text())