fix: look for 303s on successful form submissions
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Aravinth Manivannan 2025-01-02 18:20:47 +05:30
parent 131e6ac8ca
commit c868552e41
Signed by: realaravinth
GPG key ID: F8F50389936984FF

View file

@ -70,7 +70,7 @@ class HTMLClient:
def get_csrf_token(self, url: str) -> str:
resp = self.session.get(url, allow_redirects=False)
if resp.status_code != 200 and resp.status_code != 302:
if resp.status_code != 200 and resp.status_code != 302 and resp.status_code != 303:
print(resp.status_code, resp.text)
raise Exception(f"Can't get csrf token: {resp.status_code}")
csrf = self.__get_csrf_token(resp.text)