Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: gateway conformance non-existent path on dag-cbor #38

Closed
SgtPooki opened this issue Mar 30, 2024 · 0 comments · Fixed by #39
Closed

bug: gateway conformance non-existent path on dag-cbor #38

SgtPooki opened this issue Mar 30, 2024 · 0 comments · Fixed by #39

Comments

@SgtPooki
Copy link
Member

gateway conformance:

--- FAIL: TestPathing/GET_DAG-CBOR_returns_404_on_non-existing_link/Status_code (0.00s)
    run.go:53:
        Name: GET DAG-CBOR returns 404 on non-existing link
        Hint:

        Error: Status code is not 404. It is 200

        Expected Request:
        {
          "method": "GET",
          "path": "/ipfs/bafyreibs4utpgbn7uqegmd2goqz4bkyflre2ek2iwv743fhvylwi4zeeim/foo/i-do-not-exist"
        }

        Actual Request:
        GET /ipfs/bafyreibs4utpgbn7uqegmd2goqz4bkyflre2ek2iwv743fhvylwi4zeeim/foo/i-do-not-exist HTTP/1.1
        Host: host.docker.internal:8080
        User-Agent: Go-http-client/1.1
        Accept-Encoding: gzip



        Expected Response:
        {
          "statusCode": 404
        }

        Actual Response:
        HTTP/1.1 200 OK
        Transfer-Encoding: chunked
        Accept-Ranges: bytes
        Cache-Control: public, max-age=29030400, immutable
        Connection: keep-alive
        Content-Type: application/octet-stream
        Date: Sat, 30 Mar 2024 03:10:13 GMT
        Etag: "bafyreibs4utpgbn7uqegmd2goqz4bkyflre2ek2iwv743fhvylwi4zeeim"
        Keep-Alive: timeout=72
        Location: http://undefined.undefined.host.docker.internal:8080/ipfs/bafyreibs4utpgbn7uqegmd2goqz4bkyflre2ek2iwv743fhvylwi4zeeim/foo/i-do-not-exist
        X-Ipfs-Path: http://host.docker.internal:8080/ipfs/bafyreibs4utpgbn7uqegmd2goqz4bkyflre2ek2iwv743fhvylwi4zeeim/foo/i-do-not-exist

helia-http-gateway log:

Note: I requested http://helia-http-gateway.localhost/ipfs/bafyreibs4utpgbn7uqegmd2goqz4bkyflre2ek2iwv743fhvylwi4zeeim/foo/i-do-not-exist in the browser and i'm running verified-fetch from #36

[helia] 2024-03-30T03:10:49.294Z helia-http-gateway:server fetching url "http://helia-http-gateway.localhost/ipfs/bafyreibs4utpgbn7uqegmd2goqz4bkyflre2ek2iwv743fhvylwi4zeeim/foo/i-do-not-exist" with @helia/verified-fetch
[helia] 2024-03-30T03:10:49.294Z helia:verified-fetch fetch http://helia-http-gateway.localhost/ipfs/bafyreibs4utpgbn7uqegmd2goqz4bkyflre2ek2iwv743fhvylwi4zeeim/foo/i-do-not-exist
[helia] 2024-03-30T03:10:49.294Z helia:verified-fetch:get-resolved-accept-header incoming accept header "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8"
[helia] 2024-03-30T03:10:49.294Z helia:verified-fetch:get-resolved-accept-header no explicit IPLD content-type requested, returning incoming accept header text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8
[helia] 2024-03-30T03:10:49.295Z helia:verified-fetch output type application/json
[helia] 2024-03-30T03:10:49.295Z helia:verified-fetch:trace finding handler for cid code "113" and output type "application/json"
[helia] 2024-03-30T03:10:49.295Z helia:verified-fetch:trace calling handler "handleDagCbor"
[helia] 2024-03-30T03:10:49.295Z helia:verified-fetch:trace fetching bafyreibs4utpgbn7uqegmd2goqz4bkyflre2ek2iwv743fhvylwi4zeeim/foo/i-do-not-exist
[helia] 2024-03-30T03:10:49.296Z helia:verified-fetch could not decode DAG-CBOR as JSON-safe, but the client sent "Accept: application/json" Error: CBOR decode error: tag not supported (42)
[helia]     at tokensToObject (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-http-gateway/node_modules/cborg/lib/decode.js:169:11)
[helia]     at tokenToMap (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-http-gateway/node_modules/cborg/lib/decode.js:118:19)
[helia]     at tokensToObject (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-http-gateway/node_modules/cborg/lib/decode.js:161:12)
[helia]     at tokenToMap (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-http-gateway/node_modules/cborg/lib/decode.js:118:19)
[helia]     at tokensToObject (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-http-gateway/node_modules/cborg/lib/decode.js:161:12)
[helia]     at decodeFirst (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-http-gateway/node_modules/cborg/lib/decode.js:186:19)
[helia]     at decode (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-http-gateway/node_modules/cborg/lib/decode.js:202:32)
[helia]     at dagCborToSafeJSON (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-http-gateway/node_modules/@helia/verified-fetch/dist/src/utils/dag-cbor-to-safe-json.js:9:17)
[helia]     at VerifiedFetch.handleDagCbor (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-http-gateway/node_modules/@helia/verified-fetch/dist/src/verified-fetch.js:194:24)
[helia]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[helia] 2024-03-30T03:10:49.296Z helia-http-gateway:server verified-fetch response not ok:  406
[helia] 2024-03-30T03:10:49.296Z helia-http-gateway:server:trace request destroyed for url "http://helia-http-gateway.localhost/ipfs/bafyreibs4utpgbn7uqegmd2goqz4bkyflre2ek2iwv743fhvylwi4zeeim/foo/i-do-not-exist"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant