Error performing health check

I am trying to reach out to a service in a kubernetes pod, and I provide the correct url, but when the get request reaches to the XMLHttpRequest, the XMLHttpRequest adds a https header which then causes a 404.
Correct URL: file-service.data-services.svc.cluster.local/health
URL that is sent out: https://test.launchpad-leidos.com/file-service.data-services.svc.cluster.local/health

let path = serviceContext + '.data-services.svc.cluster.local';
      return new BaseWebTarget(path)
      .header('Authorization', `Bearer ${this.token}`)
      .path(healthCheckPath)
      .request()
      .get();
    });

Make sure your path variable is correct. I don’t think BaseWebTarget should be prepending anything to the url. As far as headers go, if BaseWebTarget is adding headers that are messing you up then you can provide a preRequest to BaseWebTarget constructor to alter the headers before the request is sent

function preRequest(endpoint) {
  endpoint.headers["Some-Header"] = "foo";
  return endpoint
}

new BaseWebTarget(path, {preRequest})
// ...

If BaseWebTarget is still giving you issues then you can make your request with the native Fetch API instead