-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Broader IPFS and IPNS URL support like http/s #12152
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basic feedback but I'm not familiar with curl's coding guidelines.
Any idea why many compilers can't seem to find For reference, on my local pc (gcc (GCC) 13.2.1 20230801) it works just fine. Edit |
I recommend using a dynbuf instead. Because it is less easy to mess up. |
This is a bugfix, we can merge such up until December 6... |
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.
Hi @bagder, I just updated the patch with a little off-site review feedback. Only thing changed is the CID in the testcases (from Feel free to merge it! |
There are failed tests for this change in the autobuilds. E. g. test 724: "Malformed URL". https://curl.se/dev/log.cgi?id=20231107030851-1844341#prob1 or https://curl.se/dev/log.cgi?id=20231107033909-1867421#prob1 |
I did some further tidying up in 01d9b8b so it may change things a little. |
I'm happy some testcases fail, means I've added enough cases to catch edits that might change the behavior :) |
|
Hi @mkauf Thank you for that review, that's much appreciated!
I'll fix it with that suggestion.
Very good catch! While
Fixed.
Fixed. PR incoming. |
- Fixed endianness bug in gateway file parsing - Use IPFS_PATH in tests where IPFS_DATA was used - Fixed typos from traling -> trailing - Fixed broken link in IPFS.md Follow-up to 859e88f Reported-by: Michael Kaufmann Bug: #12152 (comment) Closes #12305
No, because the pointer still points to an These answers explain it in more detail: |
Commit msg:
This fixes #12148 and a couple more issues that had been found.
I've added a lot of testcases to verify the fixes.
Still, the testing isn't super elaborate (say everything for ipfs, then another time for ipns and then everything 3x for the 3 different ways to set a gateway). The reasoning is that much code is following the same path so an issue popping up for ipns will be there for ipfs too. As long as that stays as-is then those current tests cover a lot :)
cc @lidel @Stebalien