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/IPNS URLs ignore the path #12148
Comments
On it. I know why it happens. Just finding a neat way to fix it at the moment. |
cc @lidel
This is because we only use the Tricky part, what to do with gateways containing a The issue is the same for IPNS, same code path. A fix for one fixes it for the other. |
The new(-ish) URL API should make this kind of rewriting easy to do.
|
Feel free to share a link. |
Yes, that's the one. I haven't looked at the code but curl_url API is pretty well suited to these kinds of operations.
|
@dfandrich It works quite well for the case where you want to replace the host from one url with another.
Even simpler would be a setter function that instead of a
The intent in the above example is to get the But this is just replacing.
Note the Then again, what i'm doing with an url here is probably as much of an edge case as it can be. |
I could completely believe that CURLUPART_APPEND would be a well-used feature, and CURLUPART_PREPEND would have its fans as well.
|
I'm not sold on the arguments here for extending the URL API, but I am certainly open for discussing extending and improving it. I think the examples in this thread are a little too specific for this exact use case and shows the problem: sure, if the API provided these functions with exact these properties that would help this particular use case, but when adding combined actions, decisions have to be made and it is not certain those decisions will be fine for everyone and then people will end up having to write it themselves anyway, just leaving us with code that can rarely actually be used. |
Previously just ipfs://<cid> and ipns://<cid> was supported, which is too strict for some usecases. This patch allows paths and query arguments to be used too. Making this work according to normal http semantics: ipfs://<cid>/foo/bar?key=val ipns://<cid>/foo/bar?key=val The gateway url support is changed. It now only supports gateways in the form of: http://<gateway>/foo/bar http://<gateway> Query arguments here are explicitly not allowed and trigger an intended malformed url error. There also was a crash when IPFS_PATH was set with a non trailing forward slash. This has been fixed. Lastly, a load of test cases have been added to verify the above. Reported-by: Steven Allen Fixes curl#12148 Closes curl#12152
I did this
I run:
curl -v ipns://ipfs.tech/community
I get:
The same goes for all
ipfs://
urls:curl -v ipfs://bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze/wiki/cURL
Output:
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:
But instead I see:
curl/libcurl version
curl 8.4.0
operating system
Arch Linux
The text was updated successfully, but these errors were encountered: