`/api/1/known/` returns wrong answers the SWHIDs only differ by object type
First, see how this correctly shows the content exists
$ curl -H "Content-Type: application/json" -s 'https://archive.softwareheritage.org/api/1/known/' -d '["swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2"]' | jq
{
"swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2": {
"known": true
}
}
Next see how this does too, and also that the other sorts do not exist
$ curl -s -H 'Content-Type: application/json' 'https://archive.softwareheritage.org/api/1/
known/' -d '
["swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2","swh:1:dir:94a9ed024d3859793618152ea559a168bbcbb5ed","swh:1:rev:94a9ed024d3859793618152ea559a168bbcbb5ed","swh:1:rel:94a9e
d024d3859793618152ea559a168bbcbb5ed","swh:1:snp:94a9ed024d3859793618152ea559a168bbcbb5ed"]
' | jq
{
"swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2": {
"known": true
},
"swh:1:dir:94a9ed024d3859793618152ea559a168bbcbb5ed": {
"known": false
},
"swh:1:rev:94a9ed024d3859793618152ea559a168bbcbb5ed": {
"known": false
},
"swh:1:rel:94a9ed024d3859793618152ea559a168bbcbb5ed": {
"known": false
},
"swh:1:snp:94a9ed024d3859793618152ea559a168bbcbb5ed": {
"known": false
}
}
Finally, see how this incorrectly shows none of them exist
$ curl -s -H 'Content-Type: application/json' 'https://archive.softwareheritage.org/api/1/
known/' -d '
["swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2","swh:1:dir:94a9ed024d3859793618152ea559a168bbcbb5e2","swh:1:rev:94a9ed024d3859793618152ea559a168bbcbb5e2","swh:1:rel:94a9e
d024d3859793618152ea559a168bbcbb5e2","swh:1:snp:94a9ed024d3859793618152ea559a168bbcbb5e2"]
' | jq
{
"swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2": {
"known": false
},
"swh:1:dir:94a9ed024d3859793618152ea559a168bbcbb5e2": {
"known": false
},
"swh:1:rev:94a9ed024d3859793618152ea559a168bbcbb5e2": {
"known": false
},
"swh:1:rel:94a9ed024d3859793618152ea559a168bbcbb5e2": {
"known": false
},
"swh:1:snp:94a9ed024d3859793618152ea559a168bbcbb5e2": {
"known": false
}
}
Migrated from T4224 (view on Phabricator)