Add `DetachedWindowAPI.close` calls

This commit is contained in:
Julia Johannesen 2024-09-22 18:36:46 -04:00
parent b667a68bd4
commit 5b282924ea
No known key found for this signature in database
GPG Key ID: 4A1377AF3E7FBC46
1 changed files with 5 additions and 0 deletions

View File

@ -241,11 +241,16 @@ export class ApRequestService {
if (alternate) {
const href = alternate.getAttribute('href');
if (href) {
// Since this early exits, we need to call DetachedWindowAPI.close
await window.happyDOM.close();
return await this.signedGet(href, user, false);
}
}
} catch (e) {
// something went wrong parsing the HTML, ignore the whole thing
} finally {
await window.happyDOM.close();
}
}
//#endregion