commit 7e0937a0821b2ee85d0c2bd4f97cdd4ee4722114
parent 0387d346ff4c42cbf823719f839f8164185f5eb8
Author: Sheng <webmaster0115@gmail.com>
Date: Sat, 18 May 2019 15:05:11 +0800
Enhance parse_url_data
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/webssh/static/js/main.js b/webssh/static/js/main.js
@@ -86,14 +86,17 @@ jQuery(function($){
function parse_url_data(string, filter_keys) {
- var i, pair,
+ var i, pair, key, val,
map = {},
arr = string.split('&');
for (i = 0; i < arr.length; i++) {
pair = arr[i].split('=');
- if (filter_keys.indexOf(pair[0]) !== -1) {
- map[pair[0]] = pair[1];
+ key = pair[0].toLowerCase();
+ val = pair[1];
+
+ if (filter_keys.indexOf(key) !== -1) {
+ map[key] = val;
}
}