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

Content-types with parameters: parameters not reported on 'file' event #108

Open
fabriziolussana opened this issue Nov 13, 2015 · 3 comments

Comments

@fabriziolussana
Copy link

I am trying to parse requests with parts that have content-types with parameters, e.g.:

audio/x-raw;format=S8;rate=16000

(from http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-types-definitions.html).

When the 'file' event is triggered, the mimeType reported does not show any of the above parameters, it's just 'audio/x-raw'. Is that by design?

I can see where this is happening. In multipart.js, the content-type is parsed, but why is the base alone returned with the event and not the parameters (at least those not consumed by / unknown to busboy)?

Thanks!

@mscdex
Copy link
Owner

mscdex commented Nov 13, 2015

Typically there are no parameters, that is why only the mime type is included.

The problem with adding them now is it would mean adding yet another parameter, which I am reluctant to do anymore. An addition like this would most likely be folded into a backwards incompatible change where objects are passed to event handlers instead of many function parameters. That kind of change is just something I haven't gotten to yet. If you're feeling adventurous and want to submit a PR to make these kinds of changes, feel free.

@fabriziolussana
Copy link
Author

I see. I wasn't really thinking about an object to be passed to the event handler nor expecting busboy to return those parameters as properties. When I first started my parsing attempts I was just expecting the entire content type to be passed, as a string, to the handler.

@mscdex
Copy link
Owner

mscdex commented Nov 13, 2015

Well if the literal string was passed it would no longer be just the mime type, it could include parameters, which might throw people off if they are comparing that value to some known list of mime types for example.

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

2 participants