Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Fix Edisu server connection - again
Browse files Browse the repository at this point in the history
  • Loading branch information
ilovelinux committed Jun 30, 2022
1 parent e5e7ad2 commit ff20424
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

- Set Origin since Edisu banned requests without it
## [0.1.6] - 2022-06-29

- Add dialog to show what's new after an update
Expand Down
2 changes: 2 additions & 0 deletions lib/utilities/inceptor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Future<void> initInceptor() async {
InterceptorsWrapper(
onRequest: (options, handler) async {
options.headers[HttpHeaders.userAgentHeader] = "Open Edisu";
options.headers["Origin"] =
"https://edisuprenotazioni.edisu-piemonte.it";
final token = await flutterSecureStorage.read(key: 'token');
if (token != null) {
options.headers[HttpHeaders.authorizationHeader] = "Bearer $token";
Expand Down

0 comments on commit ff20424

Please sign in to comment.