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

ipfs add doesn't work on files with "%" in the name #10536

Open
3 tasks done
bjl73o opened this issue Oct 4, 2024 · 1 comment
Open
3 tasks done

ipfs add doesn't work on files with "%" in the name #10536

bjl73o opened this issue Oct 4, 2024 · 1 comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@bjl73o
Copy link

bjl73o commented Oct 4, 2024

Checklist

Installation method

ipfs-desktop

Version

Kubo version: 0.30.0

Config

{
    "API": {
      "HTTPHeaders": {
        "Access-Control-Allow-Credentials": [
          "true"
        ],
        "Access-Control-Allow-Methods": [
          "OPTIONS",
          "GET",
          "POST"
        ],
        "Access-Control-Allow-Origin": [
          "*"
        ]
      }
    },
    "Addresses": {
      "API": "/ip4/127.0.0.1/tcp/5001",
      "Announce": [
        "/ip4/(redacted)/tcp/4001",
        "/ip4/(redacted)/udp/4002/webrtc-direct",
        "/ip4/(redacted)/udp/4002/quic-v1",
        "/ip4/(redacted)/udp/4002/quic-v1/webtransport"
      ],
      "AppendAnnounce": null,
      "Gateway": "/ip4/0.0.0.0/tcp/8080",
      "NoAnnounce": [
        "/ip4/10.0.0.0/ipcidr/8",
        "/ip4/100.64.0.0/ipcidr/10",
        "/ip4/169.254.0.0/ipcidr/16",
        "/ip4/172.16.0.0/ipcidr/12",
        "/ip4/192.0.0.0/ipcidr/24",
        "/ip4/192.0.2.0/ipcidr/24",
        "/ip4/192.168.0.0/ipcidr/16",
        "/ip4/198.18.0.0/ipcidr/15",
        "/ip4/198.51.100.0/ipcidr/24",
        "/ip4/203.0.113.0/ipcidr/24",
        "/ip4/240.0.0.0/ipcidr/4",
        "/ip6/100::/ipcidr/64",
        "/ip6/2001:2::/ipcidr/48",
        "/ip6/2001:db8::/ipcidr/32",
        "/ip6/fc00::/ipcidr/7",
        "/ip6/fe80::/ipcidr/10"
      ],
      "Swarm": [
        "/ip4/0.0.0.0/tcp/4001",
        "/ip6/::/tcp/4001",
        "/ip4/0.0.0.0/udp/4002/webrtc-direct",
        "/ip4/0.0.0.0/udp/4002/quic-v1",
        "/ip4/0.0.0.0/udp/4002/quic-v1/webtransport",
        "/ip6/::/udp/4002/webrtc-direct",
        "/ip6/::/udp/4002/quic-v1",
        "/ip6/::/udp/4002/quic-v1/webtransport"
      ]
    },
    "AutoNAT": {},
    "Bootstrap": [
      "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
      "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
      "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
      "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
      "/ip4/(redacted)/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
    ],
    "DNS": {
      "Resolvers": null
    },
    "Datastore": {
      "BloomFilterSize": 1048576,
      "GCPeriod": "30m",
      "HashOnRead": false,
      "Spec": {
        "mounts": [
          {
            "child": {
              "path": "blocks",
              "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
              "sync": true,
              "type": "flatfs"
            },
            "mountpoint": "/blocks",
            "prefix": "flatfs.datastore",
            "type": "measure"
          },
          {
            "child": {
              "compression": "none",
              "path": "datastore",
              "type": "levelds"
            },
            "mountpoint": "/",
            "prefix": "leveldb.datastore",
            "type": "measure"
          }
        ],
        "type": "mount"
      },
      "StorageGCWatermark": 70,
      "StorageMax": "2000GB"
    },
    "Discovery": {
      "MDNS": {
        "Enabled": true
      }
    },
    "Experimental": {
      "FilestoreEnabled": false,
      "GraphsyncEnabled": false,
      "Libp2pStreamMounting": false,
      "P2pHttpProxy": false,
      "ShardingEnabled": false,
      "StrategicProviding": false,
      "UrlstoreEnabled": false
    },
    "ExperimentalLibp2pStreamMounting": false,
    "Gateway": {
      "APICommands": [],
      "HTTPHeaders": {
        "Access-Control-Allow-Methods": [
          "GET",
          "HEAD"
        ],
        "Access-Control-Allow-Origin": [
          "*"
        ]
      },
      "NoDNSLink": false,
      "NoFetch": false,
      "PathPrefixes": [],
      "PublicGateways": null,
      "RootRedirect": "",
      "Writable": false
    },
    "Identity": {
      "PeerID": "(redacted)"
    },
    "Internal": {},
    "Ipns": {
      "RecordLifetime": "",
      "RepublishPeriod": "",
      "ResolveCacheSize": 500
    },
    "Libp2pStreamMounting": false,
    "Migration": {
      "DownloadSources": null,
      "Keep": ""
    },
    "Mounts": {
      "FuseAllowOther": false,
      "IPFS": "/ipfs",
      "IPNS": "/ipns"
    },
    "Peering": {
      "Peers": [
        {
          "Addrs": [
            "/ip4/(redacted)/tcp/4001",
            "/ip4/(redacted)/udp/4001/quic-v1",
            "/ip4/(redacted)/udp/4001/quic-v1/webtransport"
          ],
          "ID": "(redacted)"
        }
      ]
    },
    "Pinning": {},
    "Plugins": {
      "Plugins": null
    },
    "Provider": {
      "Strategy": ""
    },
    "Pubsub": {
      "DisableSigning": false,
      "Router": ""
    },
    "Reprovider": {
      "Strategy": "pinned"
    },
    "Routing": {
      "AcceleratedDHTClient": true,
      "Methods": null,
      "Routers": null
    },
    "Swarm": {
      "AddrFilters": null,
      "ConnMgr": {},
      "DisableBandwidthMetrics": false,
      "DisableNatPortMap": false,
      "EnableAutoRelay": false,
      "EnableRelayHop": false,
      "RelayClient": {
        "Enabled": false
      },
      "RelayService": {
        "Enabled": true
      },
      "ResourceMgr": {
        "Enabled": false
      },
      "Transports": {
        "Multiplexers": {},
        "Network": {},
        "Security": {}
      }
    }
  }

Description

Create an empty folder
Create an empty file in that folder, and name it anything. Include % in the name.
Add the folder to Kubo with ipfs add -r path

added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn path/100
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn path/100%
added QmSSYRtVFpWBEXCKKJbLv78ixGYXZhs5gX6rVdYjyhYgw4 path

Copy the folder CID from the terminal
Open the link containing % in the browser
Observe the error: 400 Bad Request
1

@bjl73o bjl73o added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Oct 4, 2024
@bjl73o
Copy link
Author

bjl73o commented Oct 4, 2024

1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

1 participant