mirror of https://github.com/mikaku/Monitorix.git
do not auto-restart the built-in HTTP server if it returned '401 Access Denied' #249
This commit is contained in:
parent
e90a70d705
commit
6ee6eabb03
|
@ -861,10 +861,12 @@ while(1) {
|
||||||
if(!$pid) {
|
if(!$pid) {
|
||||||
my $url = "http://localhost:" . $config{httpd_builtin}->{port} . $config{base_url};
|
my $url = "http://localhost:" . $config{httpd_builtin}->{port} . $config{base_url};
|
||||||
my $ua = LWP::UserAgent->new(timeout => 30);
|
my $ua = LWP::UserAgent->new(timeout => 30);
|
||||||
my $response = $ua->request(HTTP::Request->new('GET', $url));
|
my $response = $ua->get($url);
|
||||||
if(!$response->is_success) {
|
if(!$response->is_success) {
|
||||||
logger("WARNING: HTTP built-in server not responding at '$url'.");
|
if($response->status_line ne "401 Access Denied") {
|
||||||
exit(1);
|
logger("WARNING: HTTP built-in server not responding at '$url'.");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue