Skip to content

Commit

Permalink
Update DataSourceUtil.java
Browse files Browse the repository at this point in the history
  • Loading branch information
lovegaoshi committed Dec 19, 2023
1 parent c8983f4 commit 16edb72
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ private static HttpDataSource.Factory buildHttpDataSourceFactory(ReactContext co
ForwardingCookieHandler handler = new ForwardingCookieHandler(context);
container.setCookieJar(new JavaNetCookieJar(handler));
OkHttpDataSource.Factory okHttpDataSourceFactory = new OkHttpDataSource.Factory((Call.Factory) client)
.setUserAgent(getUserAgent(context))
.setTransferListener(bandwidthMeter);

if (requestHeaders != null)
if (requestHeaders != null) {
okHttpDataSourceFactory.setDefaultRequestProperties(requestHeaders);
} else {
okHttpDataSourceFactory.setUserAgent(getUserAgent(context));
}

return okHttpDataSourceFactory;
}
Expand Down

0 comments on commit 16edb72

Please sign in to comment.