Skip to content

Commit

Permalink
Omit adding the osd-version header when the Fetch request was expli…
Browse files Browse the repository at this point in the history
…citly asked to not prepend the `basePath`

Fixes #3277

Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Mar 21, 2023
1 parent de06344 commit 4236cef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/public/http/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export class Fetch {
headers: removedUndefined({
'Content-Type': 'application/json',
...options.headers,
'osd-version': this.params.opensearchDashboardsVersion,
}),
};

Expand All @@ -158,6 +157,12 @@ export class Fetch {
fetchOptions.headers['osd-system-request'] = 'true';
}

// If base-path was explicitly asked to not be prepended, this must be an external call
// ToDo: Find out if the `osd-version` header serves any purpose
if (!shouldPrependBasePath) {
fetchOptions.headers['osd-version'] = this.params.opensearchDashboardsVersion;
}

return new Request(url, fetchOptions as RequestInit);
}

Expand Down

0 comments on commit 4236cef

Please sign in to comment.