Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Commit

Permalink
Správně kontrolovat status code
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyáš Caras committed Mar 28, 2022
1 parent 6d4ed8b commit 1399dbc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
3 changes: 2 additions & 1 deletion lib/src/canteen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}
Expand All @@ -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")) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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'

Expand Down

0 comments on commit 1399dbc

Please sign in to comment.