diff --git a/lib/public/appframework/http/templateresponse.php b/lib/public/appframework/http/templateresponse.php
index 02589f4e2a41667eb52adfecb6b22f8ef9913939..c74d3b60254167f8d99874d3abd0fdb94213b169 100644
--- a/lib/public/appframework/http/templateresponse.php
+++ b/lib/public/appframework/http/templateresponse.php
@@ -134,8 +134,10 @@ class TemplateResponse extends Response {
 	 * @return string the rendered html
 	 */
 	public function render(){
+		// \OCP\Template needs an empty string instead of 'blank' for an unwrapped response
+		$renderAs = $this->renderAs === 'blank' ? '' : $this->renderAs;
 
-		$template = new \OCP\Template($this->appName, $this->templateName, $this->renderAs);
+		$template = new \OCP\Template($this->appName, $this->templateName, $renderAs);
 
 		foreach($this->params as $key => $value){
 			$template->assign($key, $value);