]> git.proxmox.com Git - pve-apiclient.git/commitdiff
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 51112e25a22acea8228aaed9d1fb4423fc852816..2ae8c1a2a96860428ef567bf82d042f3a50a0a18 100755 (executable)
@@ -87,7 +87,7 @@ sub update_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);
 }
 
@@ -290,6 +290,7 @@ sub new {
        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},