]> git.proxmox.com Git - pve-common.git/commitdiff
add request host to RESTEnvironment
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 2 Apr 2019 10:22:01 +0000 (12:22 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Apr 2019 10:16:16 +0000 (12:16 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/RESTEnvironment.pm

index b32c452947fdbdbecd6c4a5582718fdf021fa3a2..64c622f479c3543af3bf47025f39774e4f110a35 100644 (file)
@@ -231,6 +231,20 @@ sub get_u2f_challenge {
     die "no active u2f challenge\n";
 }
 
+sub set_request_host {
+    my ($self, $host) = @_;
+
+    $self->{request_host} = $host;
+}
+
+sub get_request_host {
+    my ($self, $noerr) = @_;
+
+    return $self->{request_host} if defined($self->{request_host}) || $noerr;
+
+    die "no hostname available in current environment\n";
+}
+
 sub is_worker {
     my ($class) = @_;