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

Remove code using compare_uri #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jpschewe
Copy link

After installing 3.1.5 I found that I could no longer view images in galleries without guest permissions. I tracked the issue down to this change where compare_uri was constructed instead of using request_uri. When I switched back to using compare_uri as was used in 3.1.3 everything started working again.

Note that my gallery installation is not at the root of my host, but at https://host.com/gallery

After installing 3.1.5 I found that I could no longer view images in
galleries without guest permissions. I tracked the issue down to this
change where compare_uri was constructed instead of using
request_uri. When I switched back to using compare_uri as was used in
3.1.3 everything started working again.

Note that my gallery installation is not at the root of my host, but
at https://host.com/gallery
@jpschewe
Copy link
Author

To find this I added log statements that shows the transformation of the URI. Access to this URI is to be allowed

2023-03-15 03:16:12 +00:00 --- error: request: /gallery/var/albums/jpschewe/security/security-2008-09-29/pict0006.jpg
2023-03-15 03:16:12 +00:00 --- error: ltrim(request): gallery/var/albums/jpschewe/security/security-2008-09-29/pict0006.jpg
2023-03-15 03:16:12 +00:00 --- error: url::file(ltrim(request)): /gallery/gallery/var/albums/jpschewe/security/security-2008-09-29/pict0006.jpg
2023-03-15 03:16:12 +00:00 --- error: rawurldecode(url::file(ltrim(request))): /gallery/gallery/var/albums/jpschewe/security/security-2008-09-29/pict0006.jpg

@jpschewe
Copy link
Author

This will fix #22

@jpschewe
Copy link
Author

I dug into the functions more thinking that perhaps I had a misconfiguration. Looking at the source for url::file I see that it prepends the base url. When I add debug code to output url::base() I find that it's properly set to /gallery/. However request_uri already has the base url prepended, so calling url::file with it causes the base url to be prepended a second time.

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

Successfully merging this pull request may close these issues.

1 participant