ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.16k stars 3.01k forks source link

ipfs api ignores content-transfer-encoding header #1714

Open larsks opened 9 years ago

larsks commented 9 years ago

I tried POSTing a multipart/form-data request to the ipfs http api which contained a part with base64 encoded content:

--=====8252e0e51c6346e395185d392e7a7502=====
Content-Type: image/png
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-disposition: file; filename="sample/screenshot.png"

iVBORw0KGgoAAAANSUhEUgAAAGQAAAA8CAIAAAAfXYiZAAAABGdBTUEAALGPC/xhBQAAACBjSFJN
[...]

If IPFS isn't going go handle the Content-transfer-encoding header then it should reject the request, rather than silently accepting it and storing the base64 encoded content.

jbenet commented 9 years ago

This makes sense. I'm wary of having to add error responses for a ton of headers, but we should probably support this.

breaking out the gateway into its own repo would probably help speed up its development. we should do that right after 0.4.0 lands