Skip to content

Commit c638cff

Browse files
committed
Merge branch 'main' of github.com:digma-ai/digma-vscode-plugin-python into feature/trace-support
2 parents 35c5ece + 72010f2 commit c638cff

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "digma",
33
"displayName": "Digma Continuous Feedback",
44
"description": "Code insights and Observability for OpenTelemetry. .NET, Python, more coming soon.",
5-
"version": "0.5.32",
5+
"version": "0.5.33",
66
"publisher": "digma",
77
"icon": "digma.png",
88
"engines": {
@@ -114,6 +114,10 @@
114114
},
115115
"digma.token": {
116116
"type": "string"
117+
},
118+
"digma.customHeader": {
119+
"type": "string",
120+
"description": "Specify a custom header to requests sent to Digma server. Useful in case Digma is deployed behind an ingress component, and need be routed (Example: \"Host:digma.loremipsum.com\")."
117121
}
118122
}
119123
}

src/services/analyticsProvider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,10 @@ export class AnalyticsProvider
546546
if(Settings.token.value !== undefined && Settings.token.value.trim() !== ""){
547547
requestHeaders['Authorization'] = `Token ${Settings.token.value}`;
548548
}
549-
549+
let customHeaderMatch = new RegExp(`^ *([^ ]+) *: *(.+[^ ]) *$`).exec(Settings.customHeader.value ?? '');
550+
if(customHeaderMatch){
551+
requestHeaders[customHeaderMatch[1]] = customHeaderMatch[2];
552+
}
550553

551554
let response = await fetch(
552555
url,

src/settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,6 @@ export class Settings
4848

4949
public static readonly token = new SettingsKey('token', '');
5050

51+
public static readonly customHeader = new SettingsKey('customHeader', '');
52+
5153
}

0 commit comments

Comments
 (0)