rewriteAs function
- @deprecated
Creates a Middleware
that returns a html
response with responseBody
if the Request.requestedUri
doesn't have a MIME type.
DEPRECATED! Use rewriteTo instead.
This needs some understanding of package: shelf
.
Implementation
@deprecated
Middleware rewriteAs(String responseBody) =>
createMiddleware(requestHandler: (request) {
return _hasNoMimeType(request)
? new Response.ok(responseBody, headers: {_contentType: _textHtml})
: null;
});