- 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
859e88f6533f9e
Reported-by: Michael Kaufmann
Bug: https://github.com/curl/curl/pull/12152#issuecomment-
1798214137
Closes #12305
Depending on the arguments, cURL could present the user with an error.
### Gateway file and environment variable
-cURL tried to look for the file: `~/.ipfs/gateway` but couldn't find it. It also tried to look for the `IPFS_GATEWAY` environment variable but couldn't find that either. This happens when no extra arguments are passed to cURL and letting it try to figure it out [automatically](#Automatic-gateway-detection).
+cURL tried to look for the file: `~/.ipfs/gateway` but couldn't find it. It also tried to look for the `IPFS_GATEWAY` environment variable but couldn't find that either. This happens when no extra arguments are passed to cURL and letting it try to figure it out [automatically](#automatic-gateway-detection).
Any IPFS implementation that has gateway support should expose it's URL in `~/.ipfs/gateway`. If you are already running a gateway, make sure it exposes the file where cURL expects to find it.
/* get the first line of the gateway file, ignore the rest */
while((c = getc(gateway_file)) != EOF && c != '\n' && c != '\r') {
- if(curlx_dyn_addn(&dyn, &c, 1))
+ char c_char = (char)c;
+ if(curlx_dyn_addn(&dyn, &c_char, 1))
goto fail;
}
http
</server>
<setenv>
-HOME=%PWD/%LOGDIR
-IPFS_DATA=$HOME/.ipfs
+IPFS_PATH=%LOGDIR/.ipfs
</setenv>
<name>
-IPFS with IPFS_DATA set, no traling slash
+IPFS with IPFS_PATH set, no trailing slash
</name>
<command>
ipfs://bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u
http
</server>
<setenv>
-HOME=%PWD/%LOGDIR
-IPFS_DATA=$HOME/.ipfs/
+IPFS_PATH=%LOGDIR/.ipfs/
</setenv>
<name>
-IPFS with IPFS_DATA set, with traling slash
+IPFS with IPFS_PATH set, with trailing slash
</name>
<command>
ipfs://bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u
http
</server>
<setenv>
-HOME=%PWD/%LOGDIR
-IPFS_DATA=%HOME/.ipfs/
+IPFS_PATH=%LOGDIR/.ipfs/
</setenv>
<name>
-IPFS with IPFS_DATA, no gateway file
+IPFS with IPFS_PATH, no gateway file
</name>
<command>
ipfs://bafybeidecnvkrygux6uoukouzps5ofkeevoqland7kopseiod6pzqvjg7u