Loading…
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?
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.
Example configuration:
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
gemini
protocol, but not forhttps
. I double checked it with the latestHEAD
and the result is the same (with and without the trailing slash)./
works, all other paths result in a 404 error.My commit
bd0555069e
fixes 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
lang: en
list: true
root: /home/trevor/programming/index.gmi
...
`
I encounter a 404 error even though
index.gmi
exists. 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
Dockerfile
and is part of this docker image:https://hub.docker.com/repository/docker/f00860/twins
Sourcecode for this is located here:
https://git.okoyono.de/f/twins-docker
Reviewers
Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Forgejo.