dart-lang / dart-lang/http

Header for file not correct in multipart request and headers in reverse order?

Open
#368 6 comments 5 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
1.1k
Forks
419
Avg merge
4d 14h
Merged PRs (30d)
8

Description

Reading RFC 6266 and RFC 2388 and looking at my Eiffel web framework server side library code, to handle uploading of files using multipart/form-data it seems something is off somewhere.

It seems that the class MultipartRequest from your library is doing it wrong and I want to find out if this is true.

When a browser sends a file through multipart/form-data, the header and second line of the content type is send as follows:

Content-Disposition: form-data; name="uploaded_file[]"; filename="Apps.png"
Content-Type: image/png

But when I upload a file using the http dart library, I receive:

content-type: image/png
content-disposition: form-data; name="uploaded_file[]"; filename="Apps.png"

Two things are noticable:

1. The case of the header, e.g. content-type instead of Content-Type
2. The two are in reverse order, content-type first should be content-disposition first.

I think this is wrong and should both be modified.

Can someone check if my statements are true and when due, please change them as soon as possible.

Regards, Paul

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.