boxo
boxo copied to clipboard
pinning/http: Normalize trailing slash
If one uses endpoint that ends with /
ipfs pin remote service ls --stat
mock http://127.0.0.1:5000/ 0/0/0/0
Some commands are sent with duplicate slash. For example, checking pin status for MFS autopinning in go-ipfs 0.8.0 looks like this:
Request: GET //pins?limit=10&name=policy%2F12D3KooWQi9TnZaKyqU2T9Ho15by8LyEZMxsmWdLKufMy9ppMrnR%2Fmfs&status=queued%2Cpinning%2Cpinned%2Cfailed at Fri Apr 23 2021 18:18:50 GMT+0200, IP: ::ffff:127.0.0.1, User Agent: go-pinning-service-http-client
Response: 404 0.358 ms
I believe this type of thing should be fixed in this lib, because it is responsible for adding /pins command to the endpoint passed from userland.