ensuring datasource is build with headers

This commit is contained in:
emrah88 2018-01-15 16:15:25 +01:00
parent db1d83b83e
commit 5c8e1bd6d4

View File

@ -49,7 +49,7 @@ public class DataSourceUtil {
}
public static DataSource.Factory getDefaultDataSourceFactory(Context context, DefaultBandwidthMeter bandwidthMeter, Map<String, String> requestHeaders) {
if (defaultDataSourceFactory == null) {
if (defaultDataSourceFactory == null || !requestHeaders.isEmpty()) {
defaultDataSourceFactory = buildDataSourceFactory(context, bandwidthMeter, requestHeaders);
}
return defaultDataSourceFactory;