Skip to content

Commit beca9d2

Browse files
committed
chore: fix double decoding of url params
1 parent a0075ed commit beca9d2

7 files changed

+7
-19
lines changed

Diff for: dist/vue-router.common.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -2065,9 +2065,6 @@ function createRouterError (from, to, type, message) {
20652065
error.to = to;
20662066
error.type = type;
20672067

2068-
var newStack = error.stack.split('\n');
2069-
newStack.splice(1, 2); // remove 2 last useless calls
2070-
error.stack = newStack.join('\n');
20712068
return error
20722069
}
20732070

@@ -2663,7 +2660,7 @@ function getHash () {
26632660
var hashIndex = href.indexOf('#');
26642661
if (hashIndex > -1) {
26652662
href = decodeURI(href.slice(0, hashIndex)) + href.slice(hashIndex);
2666-
} else { href = decodeURI(href); }
2663+
}
26672664
} else {
26682665
href = decodeURI(href.slice(0, searchIndex)) + href.slice(searchIndex);
26692666
}

Diff for: dist/vue-router.esm.browser.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -2038,9 +2038,6 @@ function createRouterError (from, to, type, message) {
20382038
error.to = to;
20392039
error.type = type;
20402040

2041-
const newStack = error.stack.split('\n');
2042-
newStack.splice(1, 2); // remove 2 last useless calls
2043-
error.stack = newStack.join('\n');
20442041
return error
20452042
}
20462043

@@ -2625,7 +2622,7 @@ function getHash () {
26252622
const hashIndex = href.indexOf('#');
26262623
if (hashIndex > -1) {
26272624
href = decodeURI(href.slice(0, hashIndex)) + href.slice(hashIndex);
2628-
} else href = decodeURI(href);
2625+
}
26292626
} else {
26302627
href = decodeURI(href.slice(0, searchIndex)) + href.slice(searchIndex);
26312628
}

Diff for: dist/vue-router.esm.browser.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/vue-router.esm.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -2063,9 +2063,6 @@ function createRouterError (from, to, type, message) {
20632063
error.to = to;
20642064
error.type = type;
20652065

2066-
var newStack = error.stack.split('\n');
2067-
newStack.splice(1, 2); // remove 2 last useless calls
2068-
error.stack = newStack.join('\n');
20692066
return error
20702067
}
20712068

@@ -2661,7 +2658,7 @@ function getHash () {
26612658
var hashIndex = href.indexOf('#');
26622659
if (hashIndex > -1) {
26632660
href = decodeURI(href.slice(0, hashIndex)) + href.slice(hashIndex);
2664-
} else { href = decodeURI(href); }
2661+
}
26652662
} else {
26662663
href = decodeURI(href.slice(0, searchIndex)) + href.slice(searchIndex);
26672664
}

Diff for: dist/vue-router.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -2069,9 +2069,6 @@
20692069
error.to = to;
20702070
error.type = type;
20712071

2072-
var newStack = error.stack.split('\n');
2073-
newStack.splice(1, 2); // remove 2 last useless calls
2074-
error.stack = newStack.join('\n');
20752072
return error
20762073
}
20772074

@@ -2667,7 +2664,7 @@
26672664
var hashIndex = href.indexOf('#');
26682665
if (hashIndex > -1) {
26692666
href = decodeURI(href.slice(0, hashIndex)) + href.slice(hashIndex);
2670-
} else { href = decodeURI(href); }
2667+
}
26712668
} else {
26722669
href = decodeURI(href.slice(0, searchIndex)) + href.slice(searchIndex);
26732670
}

Diff for: dist/vue-router.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/history/hash.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function getHash (): string {
132132
const hashIndex = href.indexOf('#')
133133
if (hashIndex > -1) {
134134
href = decodeURI(href.slice(0, hashIndex)) + href.slice(hashIndex)
135-
} else href = decodeURI(href)
135+
}
136136
} else {
137137
href = decodeURI(href.slice(0, searchIndex)) + href.slice(searchIndex)
138138
}

0 commit comments

Comments
 (0)