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

MIME types #12

Closed
kappsegla opened this issue Jan 28, 2022 · 2 comments · Fixed by #29
Closed

MIME types #12

kappsegla opened this issue Jan 28, 2022 · 2 comments · Fixed by #29
Assignees
Labels
good first issue Good for newcomers

Comments

@kappsegla
Copy link
Contributor

When sending a response from a webserver one of the response header values is the MIME type for the file/content we are transfering. For example if someone is requesting a file called cat.png we need to set the key Content-type to image/png.

We should have a method that from inspecting a filename and its ending can return the right MIME type for some common image formats, textfiles as html, css and application files as zip and pdf.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types

Input to the method can probably be a filename as a String or maybe a Path object? Overloaded versions?
Where to place methods and in what packet?

@kappsegla kappsegla added the good first issue Good for newcomers label Jan 28, 2022
@GreenGard
Copy link
Contributor

I think it would be most beneficial to use a Path object, having the method save specific data from the input.

Further development could include overloaded version of this method to handle the same functionality with a string input instead.

A good location for this method would be in src/main/java/org/fungover/storm/FileHandler

@helenahalldiniths
Copy link
Contributor

Not sure if GreenGard is working on this or accedently assigned/unassigned? I will give it a go since it is needed for further development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants