Skip to content

Commit

Permalink
fix: using proxy to prevent cors errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SachsenspieltCoding committed Oct 10, 2023
1 parent bdb671f commit 9ca3b8c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/api/fetch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import 'package:http/http.dart' as http;
import 'session.dart';

Future<http.Response> fetch(String url, Credentials credentials) {
final response = http
.get(Uri.parse(url), headers: {'Authorization': 'Basic ${base64Encode(utf8.encode('${credentials.username.name}:${credentials.password}'))}'});
final response = http.post(Uri.parse("https://proxy.vertretungsapp.de"),
body: jsonEncode({
"url": url,
"headers": {
'Authorization':
'Basic ${base64Encode(utf8.encode('${credentials.username.name}:${credentials.password}'))}'
}
}));
return response;
}

0 comments on commit 9ca3b8c

Please sign in to comment.