Skip to content

Wrong or insufficient result on API get /v1/lookup/hash/{hash} #68

@Bladelol

Description

@Bladelol

Description

Description:
When calling the API-Endpoint /v1/lookup/hash/{hash} with the filehash of jquery 3.7.1 i get back a wrong result or at least not the npm result.

Steps to Reproduce:
To make sure we got the right filehash we will call anothre API-Endpoint for query 3.7.1: https://data.jsdelivr.com/v1/packages/npm/jquery@3.7.1

Result(partly):

{
"type": "file",
"name": "jquery.min.js",
"hash": "/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=",
"size": 87533
}

Base64 -> Hex: hash=fc9a93dd241f6b045cbff0481cf4e1901becd0e12fb45166a8f17f95823f0b1a

Use this hash in the other endpoint: https://data.jsdelivr.com/v1/lookup/hash/fc9a93dd241f6b045cbff0481cf4e1901becd0e12fb45166a8f17f95823f0b1a

Result:

{
"type": "gh",
"name": "madmaxchow/VLOOK",
"version": "master",
"file": "/docs/js/jquery.js"
}

So the Result points to the identical file in some other GitHub Repository in the docs section instead of npm source

Expected behavior:
Search via API with a filehash e.g. https://data.jsdelivr.com/v1/lookup/hash/fc9a93dd241f6b045cbff0481cf4e1901becd0e12fb45166a8f17f95823f0b1a and get back the npm source or atleast all occurences

Actual Behavior:
Search via API with a filehash e.g. https://data.jsdelivr.com/v1/lookup/hash/fc9a93dd241f6b045cbff0481cf4e1901becd0e12fb45166a8f17f95823f0b1a and get back source in random GitHub repository

Affected jsDelivr links

https://data.jsdelivr.com/v1/lookup/hash/fc9a93dd241f6b045cbff0481cf4e1901becd0e12fb45166a8f17f95823f0b1a
https://data.jsdelivr.com/v1/packages/npm/jquery@3.7.1

Response headers

accept-ranges: bytes
access-control-allow-origin: *
access-control-expose-headers: *
age: 300684
alt-svc: h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400
cache-control: public, max-age=31536000, stale-while-revalidate=86400, stale-if-error=86400
cf-cache-status: DYNAMIC
cf-ray: 92713a82bf0971c5-FRA
content-encoding: br
content-length: 86
content-type: application/json; charset=utf-8
cross-origin-resource-policy: cross-origin
date: Tue, 08 Apr 2025 14:13:13 GMT
etag: W/"63-TDFDeXPyw9SXIRq67li0Y32jaIk"
rndr-id: 1d8d7af3-2eb2-4c1e
server: cloudflare
timing-allow-origin: *
vary: Accept-Encoding, Accept-Encoding
via: 1.1 varnish
x-cache: HIT
x-render-origin-server: Render
x-response-time: 8ms
x-robots-tag: noindex
x-served-by: cache-fra-eddf8230141-FRA
x-timer: S1744121593.995989,VS0,VE4

Information

  • Device OS: Ubuntu 22
  • Commandline
  • Your location: Germany

Requisites

  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.
  • I understand that not filling out this template correctly will lead to the issue being closed.

Additional content

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions