Last active
May 16, 2019 06:09
-
-
Save Mistic92/32666a79e3f28e40b25f87234e228b00 to your computer and use it in GitHub Desktop.
Fix for Facebook avatar api bug for Glide using OkHttp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ApiNetworkInterceptor implements Interceptor { | |
@Override | |
public Response intercept(Chain chain) throws IOException { | |
if (chain.request().url().host().equals("graph.facebook.com")) { | |
final Response response = chain.proceed(chain.request()); | |
final int code = response.code(); | |
if(code==200){ | |
response.header("content-disposition","inline"); | |
} | |
return response; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
same here, I am getting this error from Android Studio Logcat:
2019-05-16 14:05:43.412 17616-17616/com.xx.xx W/Glide: Load failed for https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2032166180243664&height=200&width=200&ext=1560578742&hash=AeQ9b1ak94nf6Vxn with size [100x100]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 cause:
java.net.UnknownHostException(Unable to resolve host "platform-lookaside.fbsbx.com": No address associated with hostname)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
There was 1 cause:
java.net.UnknownHostException(Unable to resolve host "platform-lookaside.fbsbx.com": No address associated with hostname)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
There was 1 cause:
java.net.UnknownHostException(Unable to resolve host "platform-lookaside.fbsbx.com": No address associated with hostname)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class java.net.UnknownHostException: Unable to resolve host "platform-lookaside.fbsbx.com": No address associated with hostname