Commit Graph

9 Commits

Author SHA1 Message Date
Marcin Rataj
d6de97b417
docs: gateway.md (#8825)
Adds link to relevant pages at docs.ipfs.io
2022-03-28 16:31:36 +02:00
Marcin Rataj
4cabdfefbf
feat(gateway): Block and CAR response formats (#8758)
* feat: serveRawBlock implements ?format=block
* feat: serveCar implements ?format=car
* feat(gw): ?format= or Accept HTTP header

- extracted file-like content type responses to separate .go files
- Accept HTTP header with support for application/vnd.ipld.* types

* fix: use .bin for raw block content-disposition

.raw may be handled by something, depending on OS, and .bin
seems to be universally "binary file" across all systems:
https://en.wikipedia.org/wiki/List_of_filename_extensions_(A%E2%80%93E)

* refactor: gateway_handler_unixfs.go

- Moved UnixFS response handling to gateway_handler_unixfs*.go files.
- Removed support for X-Ipfs-Gateway-Prefix (Closes #7702)

* refactor: prefix cleanup and readable paths

- removed dead code after X-Ipfs-Gateway-Prefix is gone
  (https://github.com/ipfs/go-ipfs/issues/7702)
- escaped special characters in content paths returned with http.Error
  making them both safer and easier to reason about (e.g. when invisible
  whitespace Unicode is used)
2022-03-17 17:15:24 +01:00
Manuel Alonso
edb32ac3d7
chore(gateway): debug logging for the http requests (#8518)
* chore(gateway): better logging for the http requests

* chore(gateway): removed defer and add more data to the final log

* chore(gateway): debug logging refactor

* chore(gateway): use debug w/o context when only msg

* doc: add cmd for log level

* chore: add more logs and address fedback

* chore(gateway): log subdomains and from=requestURI, refactor

* chore(gateway): fix debug redirect
2022-02-15 17:13:09 -05:00
Marcin Rataj
fd01acdfc0
feat(gateway): ?filename with download=true
This implements 'attachment' mode triggered then
?filename parameter is accompanied with &download=true

When Content-Disposition: attachment is detected by a modern browser
it will skip rendering and immediately open the "save as" dialog,
making this useful feature for using IPFS gateway as target of
"Download" links on various websites.

Parameter name was suggested in:
https://github.com/ipfs/go-ipfs/pull/4177#issuecomment-414870327
2020-09-16 22:15:18 +02:00
Steven Allen
e6968c9f22 doc(gateway): document dnslink 2019-11-15 16:53:25 -08:00
Steven Allen
9886fc06fc switch to base32 by default for CIDv1
fixes #6220

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-05-13 10:57:53 -07:00
Steven Allen
f21b4cd30a docs: add some minimal read-only API documentation
fixes #5436

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-09-06 17:47:11 -07:00
Steven Allen
d5f67d5d7e fix the default gateway port
reported by @sixcorners in
https://github.com/ipfs/go-ipfs/pull/5393#issuecomment-417908209

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-09-02 09:37:43 -07:00
Steven Allen
1af6717eff add some basic gateway documentation
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-08-20 15:53:10 -07:00