Gracefully handle lack of the cookie
This commit is contained in:
@ -60,6 +60,9 @@ function uupEncryptedData() {
|
||||
|
||||
if(empty($cookieInfo)) {
|
||||
$data = sendWuPostRequestHelper('client', 'composeGetCookieRequest', [], false);
|
||||
if($data === false || $data['error'] != 200)
|
||||
return false;
|
||||
|
||||
$cookieInfo = uupSaveCookieFromResponse($data['out']);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
function uupApiVersion() {
|
||||
return '1.43.1';
|
||||
return '1.43.2';
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__).'/auths.php';
|
||||
|
@ -362,8 +362,11 @@ XML;
|
||||
|
||||
// Composes POST data for fetching the latest update information from Windows Update
|
||||
function composeFetchUpdRequest($arch, $flight, $ring, $build, $sku = 48, $type = 'Production', $flags = []) {
|
||||
$device = uupDevice();
|
||||
$encData = uupEncryptedData();
|
||||
if($encData === false)
|
||||
return false;
|
||||
|
||||
$device = uupDevice();
|
||||
$uuid = genUUID();
|
||||
|
||||
$createdTime = time();
|
||||
|
@ -102,6 +102,9 @@ function sendWuPostRequestHelper(
|
||||
];
|
||||
|
||||
$postData = call_user_func_array($postComposer, $postComposerArgs);
|
||||
if($postData === false)
|
||||
return false;
|
||||
|
||||
$data = sendWuPostRequestInternal($endpoints[$endpoint], $postData, $saveCookie);
|
||||
|
||||
if($data['error'] == 500 && preg_match('/<ErrorCode>(ConfigChanged|CookieExpired|InvalidCookie)<\/ErrorCode>/', $data['out'])) {
|
||||
|
Reference in New Issue
Block a user