Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit c191eea

Browse files
lidelAlan Shaw
authored and
Alan Shaw
committed
docs(readme): remove CORS Credentials header (#900)
HTTP API does not need this and we should not ask people to set it if they don't really need it. License: MIT Signed-off-by: Marcin Rataj <[email protected]>
1 parent f42d460 commit c191eea

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,9 @@ const ipfs = window.IpfsHttpClient()
155155

156156
In a web browser IPFS HTTP client (either browserified or CDN-based) might encounter an error saying that the origin is not allowed. This would be a CORS ("Cross Origin Resource Sharing") failure: IPFS servers are designed to reject requests from unknown domains by default. You can whitelist the domain that you are calling from by changing your ipfs config like this:
157157

158-
```bash
159-
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "[\"http://example.com\"]"
160-
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials "[\"true\"]"
161-
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"POST\", \"GET\"]"
158+
```console
159+
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://example.com"]'
160+
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST", "GET"]'
162161
```
163162

164163
### Custom Headers

0 commit comments

Comments
 (0)