Správně kontrolovat status code
This commit is contained in:
parent
6d4ed8b99e
commit
1399dbca3a
3 changed files with 6 additions and 2 deletions
|
@ -1,3 +1,6 @@
|
|||
## 0.1.0-alpha.3
|
||||
- Kontrolovat správný status kód u GET požadavků
|
||||
|
||||
## 0.1.0-alpha.2
|
||||
- Nevytvářet debugovací soubor
|
||||
- Místo ziskejKredit používáme ziskejUzivatele (Třída Uzivatel)
|
||||
|
|
|
@ -122,6 +122,7 @@ class Canteen {
|
|||
if (res.headers['set-cookie']!.contains("remember-me=;")) {
|
||||
return false; // špatné heslo
|
||||
}
|
||||
print(res.statusCode);
|
||||
if (res.statusCode != 302) {
|
||||
throw Exception("Chyba: ${res.body}");
|
||||
}
|
||||
|
@ -144,7 +145,7 @@ class Canteen {
|
|||
? "; " + cookies["remember-me"]! + ";"
|
||||
: ";"),
|
||||
});
|
||||
if (r.statusCode != 302) {
|
||||
if (r.statusCode != 200) {
|
||||
throw Exception("Chyba: ${r.body}");
|
||||
}
|
||||
if (r.headers.containsKey("set-cookie")) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: canteenlib
|
||||
description: Knihovna pro komunikaci se stravovacím systémem iCanteen
|
||||
version: 0.1.0-alpha.2
|
||||
version: 0.1.0-alpha.3
|
||||
repository: 'https://github.com/hernikplays/canteenlib'
|
||||
issue_tracker: 'https://github.com/hernikplays/canteenlib/issues'
|
||||
|
||||
|
|
Reference in a new issue