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

PhotoViewer not passing provided headers on Android #232

Open
rolinger opened this issue Mar 13, 2023 · 2 comments
Open

PhotoViewer not passing provided headers on Android #232

rolinger opened this issue Mar 13, 2023 · 2 comments

Comments

@rolinger
Copy link

rolinger commented Mar 13, 2023

@sarriaroman - Can you comment on this please?

I am implementing various security policies on my webserver, one of which is to check for Origin and X-Requested-With headers. My app, passing the required headers, is able to connect to my server to list photos; but on Android when clicking on those images to display them with photoviewer the connections are being rejected by the server. This tells me that PhotoViewer headers are not being passed or not being passed correctly. It's working on iOS.

With the server security on, the viewer opens and then just immediately closes. If I turn off the server security the images load properly into PhotoViewer

    var headers = {
      'X-Requested-With' : 'com.myapp',
      'Origin' : 'https://myapp/'
    }  ; 
    var options = {
        share: false, // default is false
        closeButton: true, // default is true
        copyToReference: true, // default is false
        headers: JSON.stringify(headers),  // If this is not provided, an exception will be triggered
        piccasoOptions: { } // If this is not provided, an exception will be triggered
    };

Are there any callbacks that allow me to see what exactly is being passed? Or how can I get the Plugin to show me the HTTP Headers used to connect to my server?

@rolinger
Copy link
Author

@sarriaroman - bump

@rolinger rolinger changed the title PhotoViewer not passing provided headers PhotoViewer not passing provided headers on Android Mar 17, 2023
@rolinger
Copy link
Author

rolinger commented Mar 17, 2023

@sarriaroman - Looking further into this, it looks like the provided headers aren't being passed into the Picasso.get().load(mImage) call on line 198 in PhotoActivity.java

I am not familiar with Picasso or how to write java - so not certain how to amend this.

https://stackoverflow.com/questions/24273783/android-picasso-library-how-to-add-authentication-headers/28702345#28702345

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

1 participant