Merge pull request #578 from 4b1tQu4ntN3k0/normalize-protocol-relative-urls

[linux] Fix linux nhentai cover image
This commit is contained in:
ynyx631
2025-11-01 12:06:49 +08:00
committed by GitHub

View File

@@ -52,7 +52,11 @@ abstract class ImageDownloader {
responseType: ResponseType.stream,
));
var req = await dio.request<ResponseBody>(configs['url'] ?? url,
String requestUrl = configs['url'] ?? url;
if (requestUrl.startsWith('//')) {
requestUrl = 'https:$requestUrl';
}
var req = await dio.request<ResponseBody>(requestUrl,
data: configs['data']);
var stream = req.data?.stream ?? (throw "Error: Empty response body.");
int? expectedBytes = req.data!.contentLength;