mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-30 21:13:28 +01:00 
			
		
		
		
	Header usage bugfix
This commit is contained in:
		| @@ -25,8 +25,10 @@ class HuaweiAppGallery extends AppSource { | ||||
|   getDlUrl(String standardUrl) => | ||||
|       'https://${hosts[0].replaceAll('appgallery.', 'appgallery.cloud.')}/appdl/${standardUrl.split('/').last}'; | ||||
|  | ||||
|   requestAppdlRedirect(String dlUrl) async { | ||||
|     Response res = await sourceRequest(dlUrl, followRedirects: false); | ||||
|   requestAppdlRedirect( | ||||
|       String dlUrl, Map<String, dynamic> additionalSettings) async { | ||||
|     Response res = | ||||
|         await sourceRequest(dlUrl, additionalSettings, followRedirects: false); | ||||
|     if (res.statusCode == 200 || | ||||
|         res.statusCode == 302 || | ||||
|         res.statusCode == 304) { | ||||
| @@ -53,7 +55,7 @@ class HuaweiAppGallery extends AppSource { | ||||
|   Future<String?> tryInferringAppId(String standardUrl, | ||||
|       {Map<String, dynamic> additionalSettings = const {}}) async { | ||||
|     String dlUrl = getDlUrl(standardUrl); | ||||
|     Response res = await requestAppdlRedirect(dlUrl); | ||||
|     Response res = await requestAppdlRedirect(dlUrl, additionalSettings); | ||||
|     return res.headers['location'] != null | ||||
|         ? appIdFromRedirectDlUrl(res.headers['location']!) | ||||
|         : null; | ||||
| @@ -65,7 +67,7 @@ class HuaweiAppGallery extends AppSource { | ||||
|     Map<String, dynamic> additionalSettings, | ||||
|   ) async { | ||||
|     String dlUrl = getDlUrl(standardUrl); | ||||
|     Response res = await requestAppdlRedirect(dlUrl); | ||||
|     Response res = await requestAppdlRedirect(dlUrl, additionalSettings); | ||||
|     if (res.headers['location'] == null) { | ||||
|       throw NoReleasesError(); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user