This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
mtime and mtime-nsecs multipart headers not sent in browser #2837
Closed
Description
The code here essentially is doing the following:
const formData = new FormData()
formData.append(
'file',
new Blob([], {type: 'application/octet-stream'}),
'file/path',
{header:{mtime:5}}
)
const req = new Request('/test', { method: 'post', body: formData })
await req.text()
Output (tested in Firefox and Chrome):
"-----------------------------227935052110062039083523745638
Content-Disposition: form-data; name=\"file\"; filename=\"file/path\"
Content-Type: application/octet-stream
-----------------------------227935052110062039083523745638--
"
Missing mtime
header. Worryingly, as far as I can see, there's no way to set custom multipart headers using the APIs we have in the browser.
The form-data
module supports header
so it's working in Node.js:
Tests for metadata are skipped here since go-ipfs does not support this feature and the tests that use js-ipfs-http-client
in js-ipfs
are run from Node.js. This is why we haven't seen failing tests for it.
Maybe we need to test against js-ipfs too, if js-ipfs is going to support features like this before go-ipfs in the future.
I'm not sure how this comment got resolved, I thought I was getting déjà vu! ipfs-inactive/js-ipfs-http-client#1186 (comment)