Rewrite middleware treats response body as a template.