feat(server): allow subpaths for machine learning URL (#28427)

This allows to use a machine learning server URL under a subpath,
such as "http://example.com/ml-server/".
This commit is contained in:
Nojus Gudinavičius
2026-05-14 15:46:31 +03:00
committed by GitHub
parent 37cc028868
commit b0c9743d9a
@@ -132,7 +132,7 @@ export class MachineLearningRepository {
private async check(url: string) {
let healthy = false;
try {
const response = await fetch(new URL('/ping', url), {
const response = await fetch(new URL('ping', url), {
signal: AbortSignal.timeout(this.config.availabilityChecks.timeout),
});
if (response.ok) {
@@ -170,7 +170,7 @@ export class MachineLearningRepository {
...this.config.urls.filter((url) => !this.isHealthy(url)),
]) {
try {
const response = await fetch(new URL('/predict', url), { method: 'POST', body: formData });
const response = await fetch(new URL('predict', url), { method: 'POST', body: formData });
if (response.ok) {
this.setHealthy(url, true);
return response.json();