allow to specify cookie_name
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 6 Apr 2017 09:03:41 +0000 (11:03 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 6 Apr 2017 09:03:41 +0000 (11:03 +0200)
PVE/APIClient/LWP.pm

index 51112e2..2ae8c1a 100755 (executable)
@@ -87,7 +87,7 @@ sub update_ticket {
     $self->{ticket} = $ticket;
 
     my $encticket = uri_escape($ticket);
     $self->{ticket} = $ticket;
 
     my $encticket = uri_escape($ticket);
-    my $cookie = "PVEAuthCookie=$encticket; path=/; secure;";
+    my $cookie = "$self->{cookie_name}=$encticket; path=/; secure;";
     $agent->default_header('Cookie', $cookie);
 }
 
     $agent->default_header('Cookie', $cookie);
 }
 
@@ -290,6 +290,7 @@ sub new {
        host => $param{host} || 'localhost',
        port => $param{port},
        protocol => $param{protocol},
        host => $param{host} || 'localhost',
        port => $param{port},
        protocol => $param{protocol},
+       cookie_name => $param{cookie_name} // 'PVEAuthCookie',
        manual_verification => $param{manual_verification},
        cached_fingerprints => $param{cached_fingerprints} || {},
        verify_fingerprint_cb => $param{verify_fingerprint_cb},
        manual_verification => $param{manual_verification},
        cached_fingerprints => $param{cached_fingerprints} || {},
        verify_fingerprint_cb => $param{verify_fingerprint_cb},