From 5d0681088d62e3d5210852a38291eb86c37c4486 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sat, 5 Aug 2017 21:34:27 +0430 Subject: [PATCH] Hide debug box on debug:false prevents potential security bugs --- lib/app/components/nuxt-error.vue | 5 +++-- lib/app/views/error.html | 3 ++- lib/builder/builder.js | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/app/components/nuxt-error.vue b/lib/app/components/nuxt-error.vue index 24b6eadde9..fe022885bf 100644 --- a/lib/app/components/nuxt-error.vue +++ b/lib/app/components/nuxt-error.vue @@ -5,8 +5,8 @@

{{ error.statusCode }}

-

{{ $route.path }}

-
{{ error.message }}<%if(isDev){%>
{{ error.stack }}<%}%>
+

{{ error.message }}

+ <%if(debug){%>
URI: {{ $route.path }}
{{ error.stack }}
<%}%>

Back to the home page

@@ -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; diff --git a/lib/app/views/error.html b/lib/app/views/error.html index 533ee97da7..21e1c2d18d 100644 --- a/lib/app/views/error.html +++ b/lib/app/views/error.html @@ -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 {

{{ status }}

{{ name }}

-
{{ message }}
+ <%if(debug){%>
{{ message }}
<%}%>
diff --git a/lib/builder/builder.js b/lib/builder/builder.js index e8de41e192..20e690da37 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -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,