From 1f020cdc40987b7adcc1733a22dcf24aa74aa681 Mon Sep 17 00:00:00 2001 From: tamihiro Date: Sun, 9 Jun 2019 21:39:21 +0900 Subject: [PATCH] Encode `+` when it appears in URL. This patch takes care of encoding `+` within URL, such as `View the BGP map` link on the output of `show route where net ~ [ + ]` response. --- static/js/lg.js | 2 +- templates/layout.html | 2 +- templates/route.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/lg.js b/static/js/lg.js index 18424b0..358fc95 100644 --- a/static/js/lg.js +++ b/static/js/lg.js @@ -14,7 +14,7 @@ function reload(){ loc = "/" + request_type + "/" + hosts + "/" + proto; if (request_type != "summary" ){ if( request_args != undefined && request_args != ""){ - loc = loc + "?q=" + escape(request_args); + loc = loc + "?q=" + encodeURIComponent(request_args); change_url(loc) } } else { diff --git a/templates/layout.html b/templates/layout.html index a5e92f0..34071b0 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -84,7 +84,7 @@ {% for hosts, proto, request_type, request_args in session.history %} - + {{hosts}}/{{proto}}: {{ commands_dict[request_type]|replace("...", request_args) }} diff --git a/templates/route.html b/templates/route.html index 4e11ecc..72eac07 100644 --- a/templates/route.html +++ b/templates/route.html @@ -3,7 +3,7 @@ {% for host in detail %}

{{host}}: {{command}} - View the BGP map + View the BGP map

{% if session.request_args != expression|replace("/32","")|replace("/128","") %} DNS: {{session.request_args}} => {{expression|replace("/32","")|replace("/128","")}}