diff --git a/lib/app_sources/gitlab.dart b/lib/app_sources/gitlab.dart index 3e1e701..d661a00 100644 --- a/lib/app_sources/gitlab.dart +++ b/lib/app_sources/gitlab.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:html/parser.dart'; @@ -104,6 +105,21 @@ class GitLab extends AppSource { String? changeLogPageFromStandardUrl(String standardUrl) => '$standardUrl/-/releases'; + @override + Future?> getRequestHeaders( + Map additionalSettings, + {bool forAPKDownload = false}) async { + // Change headers to pacify, e.g. cloudflare protection + // Related to: (#1397, #1389, #1384, #1382, #1381, #1380, #1359, #854, #785, #697) + var headers = {}; + headers[HttpHeaders.refererHeader] = 'https://gitlab.com'; + if (headers.isNotEmpty) { + return headers; + } else { + return null; + } + } + @override Future getLatestAPKDetails( String standardUrl,