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

fix multipart/form-data #948

Merged
merged 1 commit into from
Jul 11, 2019
Merged

Conversation

MichaelMure
Copy link
Contributor

This PR is the counterpart of ipfs/go-ipfs-files#8

According to https://tools.ietf.org/html/rfc7578#section-4.2, in a Content-Disposition header
of a part in a multipart/form-data body:

  • the disposition must be of type form-data
  • a name parameter (not explicitely specified by the RFC, but I suppose non-empty)

As this name parameter is unused by IPFS, this commit simply generate a placeholder with
a counter, to conform to the HTTP specification.

I couldn't test properly that this fix actually works properly, so please test thoroughly.

According to https://tools.ietf.org/html/rfc7578#section-4.2, in a Content-Disposition header
of a part in a multipart/form-data body:

- the disposition must be of type `form-data`
- a `name` parameter (not explicitely specified by the RFC, but I suppose non-empty)

As this `name` parameter is unused by IPFS, this commit simply generate a placeholder with
a counter, to conform to the HTTP specification.
@hugomrdias
Copy link
Contributor

for this to work ipfs/multipart needs to support this, or else js-ipfs api will break.

@alanshaw
Copy link
Contributor

for this to work ipfs/multipart needs to support this, or else js-ipfs api will break.

I think it is already supported. https://github.com/ipfs/js-ipfs-multipart/blob/master/src/parser.js#L18

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants