Strip path from root
Openf wants to merge 3 commits from
Reference in New Issue
There is no content yet.
Delete Branch 'f/twins:path-strip'
Deleting a branch is permanent. It CANNOT be undone. Continue?
If there is a path (the URL path) specified under paths in the
configuration, which points to a root (a physical folder on the
filesystem), this path should not be attached to the root. This fix will
do that. It strips the path from the root.
Thanks. From CONFIGURATION.md:
Paths which are folders should always be specified with a trailing slash. If you are encountering issues when specifying paths this way, please open an issue.
I am not sure if I made my point clear. This works partially for the
geminiprotocol, but not for
https. I double checked it with the latest
HEADand the result is the same (with and without the trailing slash).
/works, all other paths result in a 404 error.
bd0555069efixes this by removing the path from the root, because it will added twice.
@tslocum Can you please verify this?
Thanks for submitting these changes. When using the following path configurations:
hosts: localhost: ... paths: - path: /sitez1 lang: en list: true root: /home/trevor/programming - path: /sitez2
I encounter a 404 error even though
index.gmiexists. This seems to be an issue even before applying your changes. Would you mind reproducing this locally and let me know what you find? If you don't have time to look into this I should be able to at some point over the next few weeks.
Not sure why that was formatted as a table, but you get the idea.
I've reproduced your configuration like this:
With current HEAD, I've got 404 errors for both paths (HTTPS, with and without a trailing slash). Gemini works as expected (with AND without trailing slash).
My PR fixes this, so both paths open the correct index.gmi. See the comment in my PR for the root cause.
One minor problem remains: For gemini, there is a redirect (30) if the trailing slash is missing. This redirect is not executed for HTTPS. But this is a separate issue.
It would be great if you double check my PR in order to solve the problem. ?
To get this working on my side, I've added my PR as a patch to the
Dockerfileand is part of this docker image:
Sourcecode for this is located here:
Step 1:From your project repository, check out a new branch and test the changes.
Step 2:Merge the changes and update on Forgejo.