Remove rewrite header

This commit is contained in:
René Preuß
2021-01-01 20:13:08 +01:00
parent f137ea298b
commit 763b45a77e

View File

@@ -91,8 +91,6 @@ class HttpClient
->requestStreaming($request->getMethod(), $this->getExposeUri($request), $request->getHeaders(), $request->getBody())
->then(function (ResponseInterface $response) use ($proxyConnection) {
if (! isset($response->buffer)) {
//$response = $this->rewriteResponseHeaders($response);
$response->buffer = str($response);
}
@@ -135,27 +133,6 @@ class HttpClient
return Request::fromString($data);
}
protected function rewriteResponseHeaders(ResponseInterface $response)
{
if (! $response->hasHeader('Location')) {
return $response;
}
$location = $response->getHeaderLine('Location');
if (! strstr($location, $this->connectionData->host)) {
return $response;
}
$location = str_replace(
$this->connectionData->host,
$this->configuration->getUrl($this->connectionData->subdomain),
$location
);
return $response->withHeader('Location', $location);
}
private function getExposeUri(RequestInterface $request): UriInterface
{
$exposeProto = $request->getHeader('x-expose-proto')[0];