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

[BUG] forcing Mirador viewer to use https #51

Open
rbos opened this issue Sep 3, 2024 · 3 comments
Open

[BUG] forcing Mirador viewer to use https #51

rbos opened this issue Sep 3, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@rbos
Copy link

rbos commented Sep 3, 2024

Hi,

I'm having trouble getting Mirador to play nicely with our load balancer. With various tweaks, I've gotten it to the point where it'll request the HTTP version of a tile, like

http://EXAMPLE/cantaloupe/iiif/2/http%3A%2F%EXAMPLE%2F_flysystem%2Ffedora%2F2024-08%2FMSC130-1030_01.tif/full/225,/0/default.jpg

which our load-balancer unfortunately interpolates during redirect, un-decoding the URL in the process:

https://EXAMPLE/cantaloupe/iiif/2/http:/EXAMPLE/_flysystem/fedora/2024-08/MSC130-1030_01.tif/full/225,/0/default.jpg

But if I change http to https in the first url, like so:

https://EXAMPLE/cantaloupe/iiif/2/http%3A%2F%EXAMPLE%2F_flysystem%2Ffedora%2F2024-08%2FMSC130-1030_01.tif/full/225,/0/default.jpg

the tile will render.

I notice that Mirador has buried in its code a "forceHttps" option that looks like it should be usable. How would I activate that in the Islandora module?

@rbos rbos added the bug Something isn't working label Sep 3, 2024
@kayakr
Copy link

kayakr commented Sep 3, 2024

I notice that Mirador has buried in its code a "forceHttps" option that looks like it should be usable. How would I activate that in the Islandora module?

@rbos forceHttps is part of "normalize-url" https://www.npmjs.com/package/normalize-url that mirador depends on, so I'm not sure if there is anyway to target it. I see that Mirador offers some preprocess functions that might be able to rewrite the URL? https://github.com/ProjectMirador/mirador/blob/master/src/config/settings.js#L447

@kayakr
Copy link

kayakr commented Sep 3, 2024

@rbos fyi, normalizeUrl() called in 2 places; you might be able to tweak that directly and see if you get the behaviour you want... https://github.com/search?q=repo%3AProjectMirador%2Fmirador%20normalizeUrl&type=code

@rbos
Copy link
Author

rbos commented Sep 4, 2024

Thanks. I guess I can fork a copy of the js file we're pulling in and make a few changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants