sarriaroman / photoviewer

PhotoViewer Cordova Plugin
MIT License
157 stars 216 forks source link

header is not used in plugin anywhere #219

Open ssrazeen opened 3 years ago

ssrazeen commented 3 years ago

Hi, The option gets the header, but it never used. Could you please add the header implementation as picasso add header

OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Request newRequest = chain.request().newBuilder() .addHeader("X-TOKEN", "VAL") .build(); return chain.proceed(newRequest); } }) .build();

Picasso picasso = new Picasso.Builder(context) .downloader(new OkHttp3Downloader(client)) .build();

rolinger commented 1 year ago

@ssrazeen - I have come across the same. This impacts Android only, as it seems the header is being passed in iOS and is working correctly. Have you gotten around this somehow?

I think for the above to work this line must be added to the gradle file:

compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'