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:
markjcrane
2015-09-29 14:28:48 -06:00
parent b374e5bdc5
commit dfc19a954d

View File

@@ -241,7 +241,7 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0);
header('WWW-Authenticate: Basic realm="'.$_SESSION['domain_name']." ".date('r').'"');
header('HTTP/1.0 401 Unauthorized');
header("Content-Type: text/plain");
echo 'Authorization Required';
header("Content-Length: 0");
exit;
} else {
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').'"');
unset($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']);
usleep(rand(1000000,3000000));//1-3 seconds.
echo 'Authorization Required';
$content = 'Authorization Required';
header("Content-Length: ".strval(strlen($content)));
echo $content;
exit;
}
}