mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-03-24 01:05:40 +00:00
Set content lenght to prevent chunking when providing HTTP 401. This should fix Yealink provisioning for the new firmware changes.
This commit is contained in:
@@ -241,7 +241,7 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0);
|
|||||||
header('WWW-Authenticate: Basic realm="'.$_SESSION['domain_name']." ".date('r').'"');
|
header('WWW-Authenticate: Basic realm="'.$_SESSION['domain_name']." ".date('r').'"');
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
header("Content-Type: text/plain");
|
header("Content-Type: text/plain");
|
||||||
echo 'Authorization Required';
|
header("Content-Length: 0");
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
if ($_SERVER['PHP_AUTH_USER'] == $provision["http_auth_username"] && $_SERVER['PHP_AUTH_PW'] == $provision["http_auth_password"]) {
|
if ($_SERVER['PHP_AUTH_USER'] == $provision["http_auth_username"] && $_SERVER['PHP_AUTH_PW'] == $provision["http_auth_password"]) {
|
||||||
@@ -252,7 +252,9 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0);
|
|||||||
header('WWW-Authenticate: Basic realm="'.$_SESSION['domain_name']." ".date('r').'"');
|
header('WWW-Authenticate: Basic realm="'.$_SESSION['domain_name']." ".date('r').'"');
|
||||||
unset($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']);
|
unset($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']);
|
||||||
usleep(rand(1000000,3000000));//1-3 seconds.
|
usleep(rand(1000000,3000000));//1-3 seconds.
|
||||||
echo 'Authorization Required';
|
$content = 'Authorization Required';
|
||||||
|
header("Content-Length: ".strval(strlen($content)));
|
||||||
|
echo $content;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user