Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 7feba18

Browse files
committed
fix: reverse proxy url fix
1 parent 21825fa commit 7feba18

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

ui/src/app/shared/api/task.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export class TaskService {
264264
`tasks/logs/${taskExecution.externalExecutionId}?platformName=${platformName}&schemaTarget=${taskExecution.schemaTarget}`;
265265
const params = new HttpParams({encoder: new DataflowEncoder()});
266266
return this.httpClient
267-
.get<any>(url, {
267+
.get<any>(UrlUtilities.fixReverseProxyUrl(url), {
268268
headers,
269269
params
270270
})

ui/src/app/url-utilities.service.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,17 @@ export class UrlUtilities {
2424
path += path.endsWith('/') ? '' : '/';
2525
return path;
2626
}
27+
28+
public static fixReverseProxyUrl(url: string) {
29+
try {
30+
const urlToFix: URL = new URL(url);
31+
const baseUrl: URL = new URL(window.location.href);
32+
urlToFix.host = baseUrl.host;
33+
urlToFix.protocol = baseUrl.protocol;
34+
urlToFix.port = baseUrl.port;
35+
return urlToFix.href;
36+
} catch (_) {
37+
return url;
38+
}
39+
}
2740
}

0 commit comments

Comments
 (0)