Skip to content

Instantly share code, notes, and snippets.

@communikein
Created December 15, 2017 15:25
Show Gist options
  • Save communikein/122e8dc6a4d88fc7f55d54d34f593174 to your computer and use it in GitHub Desktop.
Save communikein/122e8dc6a4d88fc7f55d54d34f593174 to your computer and use it in GitHub Desktop.
final class ProfilePictureRequest extends ImageRequest {
private User mUser;
public ProfilePictureRequest(User user, String url,
Response.Listener<Bitmap> listener, int maxWidth,
int maxHeight, ImageView.ScaleType scaleType,
Bitmap.Config decodeConfig, Response.ErrorListener errorListener) {
super(url, listener, maxWidth, maxHeight, scaleType, decodeConfig, errorListener);
this.mUser = user;
}
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("Authorization", "Basic " + mUser.getAuthToken());
headers.put("Cookie", "sessionid=" + mUser.getSessionID());
return headers;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment