What is the feature you are proposing?
Currently, MIME types parameter are set through mechanical determination.
|
if (mimeType && mimeType.startsWith('text')) { |
|
mimeType += '; charset=utf-8' |
|
} |
This has several problems.
- There are other items besides
text/* for which I want to specify a charset parameter (image/svg+xml, application/xhtml+xml, application/xml)
- According to IANA specifications, not all
text/* formats have a charset parameter
Therefore, we will eliminate this processing and instead specify the charset parameter individually using the _baseMimes variable. (e.g. css: 'text/css; charset=utf-8',)
Furthermore, in the getExtension() function, we will modify the logic to perform the check after removing the parameter instead.
What is the feature you are proposing?
Currently, MIME types parameter are set through mechanical determination.
hono/src/utils/mime.ts
Lines 16 to 18 in fa8eef7
This has several problems.
text/*for which I want to specify acharsetparameter (image/svg+xml,application/xhtml+xml,application/xml)text/*formats have acharsetparameterTherefore, we will eliminate this processing and instead specify the
charsetparameter individually using the_baseMimesvariable. (e.g.css: 'text/css; charset=utf-8',)Furthermore, in the
getExtension()function, we will modify the logic to perform the check after removing the parameter instead.