]> git.proxmox.com Git - pve-http-server.git/commitdiff
store Host header in rpc environment
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 2 Apr 2019 10:22:02 +0000 (12:22 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Apr 2019 10:16:38 +0000 (12:16 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
PVE/APIServer/AnyEvent.pm

index 1a01d1737ad29c9285459d5985c5bc439d188994..151d1a10f53751e573ecef3ab7b55d8254fe3048 100644 (file)
@@ -1194,11 +1194,15 @@ sub unshift_read_header {
 
                my $len = $r->header('Content-Length');
 
+               my $host_header = $r->header('Host');
+               my $rpcenv = $self->{rpcenv};
+               $rpcenv->set_request_host($host_header);
+
                # header processing complete - authenticate now
 
                my $auth = {};
                if ($self->{spiceproxy}) {
-                   my $connect_str = $r->header('Host');
+                   my $connect_str = $host_header;
                    my ($vmid, $node, $port) = $self->verify_spice_connect_url($connect_str);
                    if (!(defined($vmid) && $node && $port)) {
                        $self->error($reqstate, HTTP_UNAUTHORIZED, "invalid ticket");