several false positive for containsCID
Closed this issue · 7 comments
nschwermann commented
Here is one example https://www.supbirds.com/meta/59.json I can produce several more...
if(gatewayTools.containsCID(json.image)){
try {
image = gatewayTools.convertToDesiredGateway(json.image, gateway);
}catch(error){
console.log(error)
image = json.image;
}
}
rommel-pinata commented
Hello @nschwermann,
Not sure I understand the problem, this package assumes there's a CID on the URL. However, 59.json is not a proper CID. That's why it throws an error.
nschwermann commented
@rommel-pinata are you saying gatewayTools.containsCID assumes the url passed to will always contain a CID? Do I not understand its usecase? It should return false for the url I provided not throw an error (which it doesn't throw an error it returns true)
rommel-pinata commented
nschwermann commented
Ok you can close the ticket then I opened it 6 months ago must be fixed.
…On Fri, Apr 8, 2022 at 9:50 AM rommel-pinata ***@***.***> wrote:
[image: Screen Shot 2022-04-08 at 08 49 56]
<https://user-images.githubusercontent.com/103078675/162463918-c28a8d41-3ce4-4cf9-bb1e-ff44dd1dbd04.png>
I added your URL to my spec and it return false.
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGZSBKILDJYDQ3E52SZKRDVEBBUDANCNFSM5HZP4JVA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
*Nathan Schwermann*
*785-312-0080*
rommel-pinata commented
Thanks @nschwermann, @starryeyez024 You can close this issue :)
0x-jj commented
@rommel-pinata I have encountered a false positive
gatewayTools.containsCID('https://api.niftygateway.com/lucid-dreams-angels/193');
{ containsCid: true, cid: '193' }
rommel-pinata commented
Thanks @0x-jj I was able to reproduce the error, I'll create an issue about it.