Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - why not use okhttp for HTTP? #577

Open
Buthrakaur opened this issue Oct 31, 2018 · 2 comments
Open

Android - why not use okhttp for HTTP? #577

Buthrakaur opened this issue Oct 31, 2018 · 2 comments

Comments

@Buthrakaur
Copy link
Contributor

Hello,
I just got into problems using Azure CDN with our RN app - Azure uses Brotli compression (content-encoding: br), which isn't supported on Android by default. I was able to solve the problem by custom OkHttpClientFactory (OkHttpClientProvider.setOkHttpClientFactory(factory)) and custom Brotli decompression network interceptor, but this solves just RN fetch() downloads and not RNFS.downloadFile(). I didn't find any easy solution how implement the Brotli support for RNFS as it doesn't use okhttp contrary to React Native so I'm not able to plug in the interceptor. Is there any reason for that? Would it make sense to rewrite the Downloader class to use okhttp to be in line with RN and submit a PR?

@mikehardy
Copy link

I am also curious - using okhttp provided by react-native would transitively solve the SSL problems with the still-supported Android 4.x devices that fail on HTTP transactions #446

@itinance - are you interested in a downloader PR that would use built-in react-native okhttp vs the current low-level work? or is there something I'm not aware of that makes this unworkable?

@mikehardy
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants