Page MenuHomeSoftware Heritage

Resolution of SWH-IDs fails with trailing slashes in the origin field
Closed, MigratedEdits Locked

Description

Resolution of SWH-IDs fails with 404 if there is a trailing slash in the origin field, followed by a semicolon, as in the following

https://archive.softwareheritage.org/swh:1:cnt:c60366bc03936eede6509b23307321faf1035e23;origin=https://github.com/sagemath/sage/;lines=473-537

while it works if we swap the parameters, as in the following

https://archive.softwareheritage.org/swh:1:cnt:c60366bc03936eede6509b23307321faf1035e23;lines=473-537;origin=https://github.com/sagemath/sage/

Event Timeline

rdicosmo created this task.

That's because all origin urls coming from Github are stored without a trailing slash in our database.

The following url is valid for instance: https://archive.softwareheritage.org/swh:1:cnt:c60366bc03936eede6509b23307321faf1035e23;origin=https://github.com/sagemath/sage;lines=473-537

However, I agree this is really confusing and a similar issue has already been reported (T1852, but this time it is about origin urls with trailing slashes).

I will find a way to workaround this.

olasd renamed this task from Resolution of SWH-IDs fails with trailing backslashes in the origin field to Resolution of SWH-IDs fails with trailing slashes in the origin field.Feb 18 2020, 12:12 PM
olasd updated the task description. (Show Details)

What about try to resolve the origin url as it is, and in case of failure
retry without trailing slash?

Roberto

Le mar. 18 févr. 2020 à 11:57, anlambert (Antoine Lambert) <
forge@softwareheritage.org> a écrit :

anlambert added a comment. View Task
https://forge.softwareheritage.org/T2289

That's because all origin urls coming from Github are stored without a
trailing slash in our database.

The following url is valid for instance:
https://archive.softwareheritage.org/swh:1:cnt:c60366bc03936eede6509b23307321faf1035e23;origin=https://github.com/sagemath/sage;lines=473-537

However, I agree this is really confusing and a similar issue has already
been reported (T1852 https://forge.softwareheritage.org/T1852, but this
time it is about origin urls with trailing slashes).

I will find a way to workaround this.

*TASK DETAIL*
https://forge.softwareheritage.org/T2289

*EMAIL PREFERENCES*
https://forge.softwareheritage.org/settings/panel/emailpreferences/

*To: *anlambert
*Cc: *zack, moranegg, rdicosmo, Iamshankhadeep, shisus, anlambert

What about try to resolve the origin url as it is, and in case of failure
retry without trailing slash?

This is exactly what I will implement. I will also handle the case when the trailing slash is missing (for debian origins).