Skip to content
Snippets Groups Projects
Commit 9cf7ad9d authored by vlorentz's avatar vlorentz Committed by Antoine Lambert
Browse files

QualifiedSWHID: Fix (de)serialization of 'origin' qualifier

Having the escaped URL in `swhid.origin` is inconsistent with self.path
(which is always escaped) and never what we want, because it is only
useful while serializing, which is already handled by `__str__`.

This led to swh/devel/swh-indexer#4738
where swh-deposit parsed a qualified SWHID, then used `.origin` to get
an origin URL.

Additionally, as serialization always escapes the `origin` qualifier,
this means that deserializing then re-serializing a qualified SWHID
would double-escape it.

Finally, fixing this made the test uncover that `%` was not escaped
while serializing, while `;` was, leading to incorrect (and ambiguous)
escaped URLs.
parent f1f62388
No related branches found
No related tags found
1 merge request!348QualifiedSWHID: Fix (de)serialization of 'origin' qualifier
Pipeline #8797 passed
Status
Pipeline
Created by
Stages
Actions
Passed

avatar

No artifacts found

Passed

avatar

No artifacts found