Skip to content

IPFS/IPNS URLs ignore the path #12148

@Stebalien

Description

@Stebalien

I did this

I run:

curl -v ipns://ipfs.tech/community

I get:

*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET /ipns/ipfs.tech HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.4.0
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Access-Control-Allow-Headers: Content-Type
< Access-Control-Allow-Headers: Range
< Access-Control-Allow-Headers: User-Agent
< Access-Control-Allow-Headers: X-Requested-With
< Access-Control-Allow-Methods: GET
< Access-Control-Allow-Methods: HEAD
< Access-Control-Allow-Methods: OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Content-Length
< Access-Control-Expose-Headers: Content-Range
< Access-Control-Expose-Headers: X-Chunked-Output
< Access-Control-Expose-Headers: X-Ipfs-Path
< Access-Control-Expose-Headers: X-Ipfs-Roots
< Access-Control-Expose-Headers: X-Stream-Output
< Content-Type: text/html; charset=utf-8
< Location: /ipns/ipfs.tech/
< X-Ipfs-Path: /ipns/ipfs.tech
< X-Ipfs-Roots: QmbMTqnawMAbD4Fzgd5NM9GpKT67FdNZ1EsH8D4r52PTeT
< Date: Tue, 17 Oct 2023 18:26:48 GMT
< Content-Length: 51
< 
<a href="/ipns/ipfs.tech/">Moved Permanently</a>.

The same goes for all ipfs:// urls:

curl -v ipfs://bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze/wiki/cURL

Output:

*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET /ipfs/bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.4.0
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Access-Control-Allow-Headers: Content-Type
< Access-Control-Allow-Headers: Range
< Access-Control-Allow-Headers: User-Agent
< Access-Control-Allow-Headers: X-Requested-With
< Access-Control-Allow-Methods: GET
< Access-Control-Allow-Methods: HEAD
< Access-Control-Allow-Methods: OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Content-Length
< Access-Control-Expose-Headers: Content-Range
< Access-Control-Expose-Headers: X-Chunked-Output
< Access-Control-Expose-Headers: X-Ipfs-Path
< Access-Control-Expose-Headers: X-Ipfs-Roots
< Access-Control-Expose-Headers: X-Stream-Output
< Content-Type: text/html; charset=utf-8
< Location: /ipfs/bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze/
< X-Ipfs-Path: /ipfs/bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze
< X-Ipfs-Roots: bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze
< Date: Tue, 17 Oct 2023 18:28:37 GMT
< Content-Length: 101
< 
<a href="/ipfs/bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze/">Moved Permanently</a>.

I expected the following

I'd expect curl to fetch the requested pages. Instead, it ignores the entire path and tries to fetch the root CID/domain.

E.g., in the first request, I should see:

> GET /ipns/ipfs.tech/community HTTP/1.1

But instead I see:

> GET /ipns/ipfs.tech HTTP/1.1

curl/libcurl version

curl 8.4.0

operating system

Arch Linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions