fix dav browser error page not styled

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2020-03-19 23:44:14 +01:00
parent d3401efa2d
commit b285e19dc8
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
2 changed files with 6 additions and 3 deletions

View File

@ -25,6 +25,7 @@ namespace OCA\DAV\Files;
use OC\AppFramework\Http\Request;
use OC_Template;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\IRequest;
use Sabre\DAV\Exception;
use Sabre\DAV\Server;
@ -82,6 +83,8 @@ class BrowserErrorPagePlugin extends ServerPlugin {
$this->server->httpResponse->setStatus($httpCode);
$body = $this->generateBody();
$this->server->httpResponse->setBody($body);
$csp = new ContentSecurityPolicy();
$this->server->httpResponse->addHeader('Content-Security-Policy', $csp->buildPolicy());
$this->sendResponse();
}

View File

@ -22,12 +22,12 @@ style('core', ['styles', 'header']);
/** @param $_ array */
?>
<span class="error error-wide">
<div class="body-login-container update">
<h2><?php p($_['title']) ?></h2>
<h3><strong><?php p($l->t('Technical details')) ?></strong></h3>
<ul>
<ul class="infogroup">
<li><?php p($l->t('Remote Address: %s', $_['remoteAddr'])) ?></li>
<li><?php p($l->t('Request ID: %s', $_['requestID'])) ?></li>
</ul>
</span>
</div>