From ff20424031579cbde431039c19af35cfbd494231 Mon Sep 17 00:00:00 2001 From: ilovelinux Date: Thu, 30 Jun 2022 17:10:07 +0200 Subject: [PATCH] Fix Edisu server connection - again --- CHANGELOG.md | 1 + lib/utilities/inceptor.dart | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eacb650..ae01a15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/utilities/inceptor.dart b/lib/utilities/inceptor.dart index 88aa774..4b02855 100644 --- a/lib/utilities/inceptor.dart +++ b/lib/utilities/inceptor.dart @@ -35,6 +35,8 @@ Future 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";