setContentTypeForExtension method

void setContentTypeForExtension(
  1. String extension,
  2. ContentType contentType

Sets the associated content type for a file extension.

When a file with extension file extension is served by any instance of this type, the contentType will be sent as the response's Content-Type header.


void setContentTypeForExtension(String extension, ContentType contentType) {
  _extensionMap[extension] = contentType;