Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add access to additional multipart headers #179

Open
deathgrindfreak opened this issue Sep 28, 2018 · 3 comments
Open

Add access to additional multipart headers #179

deathgrindfreak opened this issue Sep 28, 2018 · 3 comments

Comments

@deathgrindfreak
Copy link

So I need some additional headers from multipart data (specifically a generated Content-MD5 header) and was wondering if you guys would be alright with a pull request adding this feature. I'm thinking it could just be passed in as an optional parameter in the 'field' and 'file' listeners, since that really shouldn't break backwards compatibility (though I haven't looked into the urlencoded type, my proposed change would really only impact the multipart type).

@mike-marcacci
Copy link

Hmm, how would this work? Generating a hash requires consuming the entire contents of the upload, which would result in a finished (read useless) stream being passed in the file event.

@mscdex
Copy link
Owner

mscdex commented Sep 28, 2018

'Content-MD5' is not a typical header supplied during form submission. You would need to use the underlying dicer library which is a more generic multipart parser.

@deathgrindfreak
Copy link
Author

Yeah that's what I'm getting at. I'd basically like to be able to have access to additional headers parsed by dicer (they're just skipped for now I believe). So if I added an 'X-My-Customer-Header' for each part, I'd be able to access it in the file handler. I generate the hashes on the client side, so it wouldn't be something busboy would handle.

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

No branches or pull requests

3 participants