1
0
Fork 0
mirror of https://github.com/KokaKiwi/BarInsta synced 2026-03-05 20:11:36 +00:00

more general maintenance

This commit is contained in:
Austin Huang 2020-11-02 17:09:35 -05:00
parent 81ce8ece94
commit 92f7e04757
No known key found for this signature in database
GPG key ID: 84C23AA04587A91F
18 changed files with 20 additions and 34 deletions

View file

@ -72,6 +72,7 @@ public final class LocaleUtils {
if (appLanguageIndex == 11) return "fa";
if (appLanguageIndex == 12) return "mk";
if (appLanguageIndex == 13) return "vi";
if (appLanguageIndex == 14) return "hi";
return null;
}

View file

@ -5,6 +5,7 @@ import androidx.annotation.NonNull;
import java.io.IOException;
import awais.instagrabber.utils.Constants;
import awais.instagrabber.utils.LocaleUtils;
import awais.instagrabber.utils.Utils;
import okhttp3.Interceptor;
import okhttp3.Request;
@ -22,6 +23,10 @@ public class AddCookiesInterceptor implements Interceptor {
if (request.header(userAgentHeader) == null) {
builder.addHeader(userAgentHeader, Constants.I_USER_AGENT);
}
final String languageHeader = "Accept-Language";
if (request.header(languageHeader) == null) {
builder.addHeader(languageHeader, LocaleUtils.getCurrentLocale().getLanguage() + ",en-US;q=0.8");
}
final Request updatedRequest = builder.build();
return chain.proceed(updatedRequest);
}