Hide debug box on debug:false

prevents potential security bugs
This commit is contained in:
Pooya Parsa 2017-08-05 21:34:27 +04:30
parent 24fe134641
commit 5d0681088d
3 changed files with 6 additions and 3 deletions

View File

@ -5,8 +5,8 @@
<div class="row">
<div class="column">
<h1>{{ error.statusCode }} </h1>
<h4> {{ $route.path }} </h4>
<pre class="error-box"><code>{{ error.message }}<%if(isDev){%><br>{{ error.stack }}<%}%></code></pre>
<h4> {{ error.message }} </h4>
<%if(debug){%><pre class="error-box"><code>URI: {{ $route.path }}<br>{{ error.stack }}</code></pre><%}%>
<p v-if="error.statusCode === 404 || error.statusCode === 'Whoops!'">
<nuxt-link class="error-link" to="/">Back to the home page</nuxt-link>
</p>
@ -50,6 +50,7 @@ export default {
-webkit-text-size-adjust: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-align: center;
}
.__nuxt-error-page .container {
display: flex;

View File

@ -25,6 +25,7 @@
-webkit-text-size-adjust: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-align: center;
}
.__nuxt-error-page .container {
display: flex;
@ -59,7 +60,7 @@ pre {
<div class="column">
<h1>{{ status }} </h1>
<h4> {{ name }} </h4>
<pre class="error-box"><code>{{ message }}</code></pre>
<%if(debug){%><pre class="error-box"><code>{{ message }}</code></pre><%}%>
</div>
</div>

View File

@ -137,6 +137,7 @@ export default class Builder extends Tapable {
options: this.options,
uniqBy: _.uniqBy,
isDev: this.options.dev,
debug: this.options.render.debug,
router: this.options.router,
env: this.options.env,
head: this.options.head,