Page MenuHomeSoftware Heritage

Fix SWHID resolving when origin qualifier has an equal character in its value
Closed, MigratedEdits Locked

Description

I have stumbled upon this permalink which I get when I click copy permalink:

https://archive.softwareheritage.org/swh:1:dir:53ddae53e380c56cf74dd9ad06be87e1f83fa450;origin=https://cran.r-project.org/package%3DActivePathways;visit=swh:1:snp:9b706ec3d79576d295fca2980c546d6b760ffc54;anchor=swh:1:rev:191039b4497ec53153e480cacfa1df9b46b38e6e;path=/ActivePathways//

It yields a 404 error when used.

This does not happen with copy identifier:

swh:1:dir:53ddae53e380c56cf74dd9ad06be87e1f83fa450;origin=https://cran.r-project.org/package%3DActivePathways;visit=swh:1:snp:9b706ec3d79576d295fca2980c546d6b760ffc54;anchor=swh:1:rev:191039b4497ec53153e480cacfa1df9b46b38e6e;path=/ActivePathways/

Event Timeline

moranegg created this task.

The issue is not related to the double slash at the end of the permalink but rather from the fact that the origin URL contains a = character in it (https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://cran.r-project.org/package%3DActivePathways). I will fix that asap.

anlambert renamed this task from Fix permalink with double // at the end to Fix SWHID resolving when origin qualifier has an equal character in its value.Sep 24 2020, 11:30 AM

Hopefully, the issue is related to missing URL escaping in the webapp. I implemented the fix, still some tests to write and I will push a diff during the afternoon.