fix(remote_judger/atcoder): getCsrfToken

This commit is contained in:
Baoshuo Ren 2023-02-03 16:38:27 +08:00
parent eead1d8c85
commit 0aacb14b9b
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -129,6 +129,9 @@ export default class AtcoderProvider implements IBasicProvider {
this.cookie = header['set-cookie']; this.cookie = header['set-cookie'];
} }
let value = /csrfToken = "(.+?)"/g.exec(html);
if (value) return value[1];
if (document.body.children.length < 2 && html.length < 512) { if (document.body.children.length < 2 && html.length < 512) {
throw new Error(document.body.textContent!); throw new Error(document.body.textContent!);
} }