set content-legth to 0 for vmware vcsa
This commit is contained in:
parent
b842ec970e
commit
f8d7de7ce3
|
@ -173,7 +173,8 @@ sub authenticate {
|
||||||
credentials => 1, basic => 1,
|
credentials => 1, basic => 1,
|
||||||
username => $self->{api_username},
|
username => $self->{api_username},
|
||||||
password => $self->{api_password},
|
password => $self->{api_password},
|
||||||
warning_status => '', unknown_status => '', critical_status => ''
|
warning_status => '', unknown_status => '', critical_status => '',
|
||||||
|
curl_backend_options => { header => ['Content-Length: 0'] },
|
||||||
);
|
);
|
||||||
if ($self->{http}->get_code() != 200) {
|
if ($self->{http}->get_code() != 200) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Login error [code: '" . $self->{http}->get_code() . "'] [message: '" . $self->{http}->get_message() . "']");
|
$self->{output}->add_option_msg(short_msg => "Login error [code: '" . $self->{http}->get_code() . "'] [message: '" . $self->{http}->get_message() . "']");
|
||||||
|
|
|
@ -30,10 +30,10 @@ sub new {
|
||||||
|
|
||||||
if (!defined($options{noptions}) || $options{noptions} != 1) {
|
if (!defined($options{noptions}) || $options{noptions} != 1) {
|
||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
"http-peer-addr:s" => { name => 'http_peer_addr' },
|
'http-peer-addr:s' => { name => 'http_peer_addr' },
|
||||||
"proxyurl:s" => { name => 'proxyurl' },
|
'proxyurl:s' => { name => 'proxyurl' },
|
||||||
"proxypac:s" => { name => 'proxypac' },
|
'proxypac:s' => { name => 'proxypac' },
|
||||||
"http-backend:s" => { name => 'http_backend', default => 'lwp' },
|
'http-backend:s' => { name => 'http_backend', default => 'lwp' },
|
||||||
});
|
});
|
||||||
$options{options}->add_help(package => __PACKAGE__, sections => 'HTTP GLOBAL OPTIONS');
|
$options{options}->add_help(package => __PACKAGE__, sections => 'HTTP GLOBAL OPTIONS');
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,13 @@ sub check_options {
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (defined($options{request}->{curl_backend_options}) &&
|
||||||
|
$self->{http_backend} eq 'curl') {
|
||||||
|
foreach (keys %{$options{request}->{curl_backend_options}}) {
|
||||||
|
$options{request}->{$_} = $options{request}->{curl_backend_options}->{$_};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (($options{request}->{proto} ne 'http') && ($options{request}->{proto} ne 'https')) {
|
if (($options{request}->{proto} ne 'http') && ($options{request}->{proto} ne 'https')) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Unsupported protocol specified '" . $self->{option_results}->{proto} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Unsupported protocol specified '" . $self->{option_results}->{proto} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
|
|
Loading…
Reference in New Issue