Skip to content

Commit

Permalink
Deletion of mhub_access cookie before request (manga-download#5791)
Browse files Browse the repository at this point in the history
  • Loading branch information
Druzai authored May 12, 2023
1 parent b586725 commit b62e611
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/web/mjs/connectors/MangaHub.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export default class MangaHub extends Connector {
} else {
path = `${this.url}/`;
}

const uri = new URL(path);
uri.searchParams.append('reloadKey', '1');
const request = new Request(uri, this.requestOptions);
Expand All @@ -140,12 +141,14 @@ export default class MangaHub extends Connector {
request.headers.set('Upgrade-Insecure-Requests', 1);
request.headers.delete('x-origin');
request.headers.delete('x-mhub-access');

await remote.session.defaultSession.cookies.remove(this.url, 'mhub_access');
await fetch(request);

let mhub_access = await remote.session.defaultSession.cookies.get({
url: this.url,
name: 'mhub_access',
path: '/',
path: '/'
});
mhub_access = mhub_access.shift();

Expand Down

0 comments on commit b62e611

Please sign in to comment.