-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
MediaType isn't extensible #656
Comments
Making |
What would be the downside of wrapping access to the property in a lock, to maintain Sendability safety? |
If we do this, I assume we'd want to leave |
I created a PR with the latter idea. Let me know if you have any suggestions or would prefer a different approach. |
I am currently working on an HLS server and was working to serve the stream components through HB, however when I load an
m3u8
file throughFileMiddleware
, there's no definition form3u8
inMediaType
so the browser just attempts to load it as plain text.Obviously, the simplest solution would be to just add
m3u8
toMediaType.extensionMap
, but I think that's just a band aid. Devs should be able to define additional MediaTypes that can be used by FileMiddleware.I would propose that
MediaType.extensionMap
be made privately mutable and to add a staticregisterAdditionalType(_ type: MediaType, withExtension ext: String)
toMediaType
(or, if scoping is preferable for some reason I can't foresee, perhaps registering on an instance ofFileMiddleware
)I'd be happy to make a PR for this if you guys are onboard.
The text was updated successfully, but these errors were encountered: