typeByExtension function
Sets the content type header of the response to a mime-type that
matches the give fileExtension
.
Implementation
Middleware typeByExtension(
String fileExtension, {
String unknownMimeType = 'application/unknown',
}) =>
setContentType(mimeFromExtension(fileExtension) ?? unknownMimeType);