mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
vjudge: fix set-cookie
This commit is contained in:
1 parent
0a11be95da
commit
10603d9602
2 files changed
+6
-2
No files matched your search
@@ -56,7 +56,11 @@ export default class CodeforcesProvider implements IBasicProvider {
|
||||
}
|
||||
|
||||
async getCsrfToken(url: string) {
|
||||
const { text: html } = await this.get(url);
|
||||
const { text: html, header } = await this.get(url);
|
||||
if (header['set-cookie']) {
|
||||
await this.save({ cookie: header['set-cookie'] });
|
||||
this.cookie = header['set-cookie'];
|
||||
}
|
||||
const $dom = new JSDOM(html);
|
||||
return $dom.window.document.querySelector('meta[name="X-Csrf-Token"]').getAttribute('content');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user