[pve-devel] [PATCH http-server 2/2] forward Host header in proxy_request

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Mar 27 11:16:27 CET 2019


Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 PVE/APIServer/AnyEvent.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/APIServer/AnyEvent.pm b/PVE/APIServer/AnyEvent.pm
index 151d1a1..c94e734 100644
--- a/PVE/APIServer/AnyEvent.pm
+++ b/PVE/APIServer/AnyEvent.pm
@@ -555,6 +555,10 @@ sub proxy_request {
 	$headers->{'CSRFPreventionToken'} = $token if $token;
 	$headers->{'Accept-Encoding'} = 'gzip' if ($reqstate->{accept_gzip} && $self->{compression});
 
+	if (defined(my $host = $reqstate->{request}->header('Host'))) {
+	    $headers->{Host} = $host;
+	}
+
 	my $content;
 
 	if  ($method eq 'POST' || $method eq 'PUT') {
-- 
2.11.0





More information about the pve-devel mailing list