Accept URLs without final "/" #30

Open
opened 2022-01-16 23:43:51 +01:00 by anselm · 2 comments
anselm commented 2022-01-16 23:43:51 +01:00 (Migrated from gitlab.anselms.net)

[Eric Ferguson]

URLs used on "my.strathspey" sometimes require a final "/". For instance
the URL ​http://my.strathspey.org/dd/cribsource/2/ works fine
the URL ​http://my.strathspey.org/dd/cribsource/2 does not.
Proposal: add the "/" automatically if it is missing.

[Eric Ferguson] URLs used on "my.strathspey" sometimes require a final "/". For instance the URL ​http://my.strathspey.org/dd/cribsource/2/ works fine the URL ​http://my.strathspey.org/dd/cribsource/2 does not. Proposal: add the "/" automatically if it is missing.
anselm commented 2023-05-12 15:25:18 +02:00 (Migrated from gitlab.anselms.net)

This now works for resources whose paths match one of the URL patterns except <rpath:path>. Dealing with this case is difficult because we need to accept both paths that end with a slash (like …/u/anselm/stories/reelofthe51st/) and paths that lead to non-ACE resources (like /…/u/anselm/withhat.jpg). The current heuristic is that <rpath:path> will match paths ending either with a slash or else with a period and three or more alphanumeric characters (and no slash). Anything else is subject to the APPEND_SLASH mechanism.

This now works for resources whose paths match one of the URL patterns except `<rpath:path>`. Dealing with this case is difficult because we need to accept both paths that end with a slash (like `…/u/anselm/stories/reelofthe51st/`) and paths that lead to non-ACE resources (like `/…/u/anselm/withhat.jpg`). The current heuristic is that `<rpath:path>` will match paths ending either with a slash or else with a period and three or more alphanumeric characters (and no slash). Anything else is subject to the `APPEND_SLASH` mechanism.
anselm commented 2023-05-31 13:31:58 +02:00 (Migrated from gitlab.anselms.net)

The approach from the previous comment fails for resources with a size specification, as in foo.jpg@200x100, which still get a slash appended. I changed the rpath matcher to take this into account.

The approach from the previous comment fails for resources with a size specification, as in `foo.jpg@200x100`, which still get a slash appended. I changed the `rpath` matcher to take this into account.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Strathspey/ace4#30
No description provided.