Page MenuHomeSoftware Heritage

Improve error messages when resolving PURLs containing a broken/incorrect origin
Closed, MigratedEdits Locked

Description

One user reported an issue when reading a mail message containing one of our PURLs.

The original URL in the mail he received is:

https://archive.softwareheritage.org/swh:1:cnt:41ddb23118f92d7218099a5e7a990cf58f1d07fa;lines=64-72;origin=https://github.com/chrislgarry/Apollo-11/

and the mail client mangled it, eating one of the / in https://github.com (see details below)

When confronted with this situation, our WebApp returns a 400 Bad Request, which makes our archive look broken, while it's the URL that has been broken.

We should provide a more informative message in these cases, like

The origin mentioned in your request appears broken:
  https%3A/github.com/chrislgarry/Apollo-11#L64-L72
Please check your URL and try again

or (if we can check that the content is there before failing)

The Software Heritage archive has a content with the hash you provided,
but the origin mentioned in your request appears broken:
  https%3A/github.com/chrislgarry/Apollo-11#L64-L72
Please check your URL and try again

On Mon, Jun 25, 2018 at 08:12:05AM +0000, XXXX wrote:

Looks like clicking in the link in your email in Windows 10 Mail (Yes I know)
does some kind of mess with “//” at the end and I get redirected to

https://archive.softwareheritage.org/browse/content/
sha1_git:41ddb23118f92d7218099a5e7a990cf58f1d07fa/?origin=https%3A/github.com/
chrislgarry/Apollo-11#L64-L72

If I copy-paste your URL then it works, where I am redirected to

https://archive.softwareheritage.org/browse/content/
sha1_git:41ddb23118f92d7218099a5e7a990cf58f1d07fa/?origin=https%3A//github.com/
chrislgarry/Apollo-11#L64-L72

.. which work. (spot the difference!)

Event Timeline

rdicosmo triaged this task as Normal priority.Jun 25 2018, 10:08 PM
rdicosmo created this task.
rdicosmo created this object with edit policy "Subscribers".

[ Aside on the actual bug here. @rdicosmo can you change the edit policy of this task to "public"? It's the default and it's generally the right one as it allows to do stuff like change task tags and the like. ]

rdicosmo changed the edit policy from "Subscribers" to "All Users".Jun 26 2018, 9:44 AM