Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorPaul Slaughter <pslaughter@gitlab.com>2019-08-19 17:00:10 +0300
committerPaul Slaughter <pslaughter@gitlab.com>2019-08-19 18:28:23 +0300
commit4fdc34c10950863ad04a68dc2117371c95db7478 (patch)
treeb7355bf68cbc240be181f309840e788bbabb9cea /spec
parentb1905a396f7e7da89280aea4436eb7261d1cd34c (diff)
Fix mergeUrlParams handling of `+`
**What was the issue?** If a param value had `+`, it would be encoded as a literal `+` instead of a space.
Diffstat (limited to 'spec')
-rw-r--r--spec/frontend/lib/utils/url_utility_spec.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/url_utility_spec.js b/spec/frontend/lib/utils/url_utility_spec.js
index a986bc49f28..b0bdd924921 100644
--- a/spec/frontend/lib/utils/url_utility_spec.js
+++ b/spec/frontend/lib/utils/url_utility_spec.js
@@ -94,6 +94,12 @@ describe('URL utility', () => {
it('adds and updates encoded params', () => {
expect(urlUtils.mergeUrlParams({ a: '&', q: '?' }, '?a=%23#frag')).toBe('?a=%26&q=%3F#frag');
});
+
+ it('treats "+" as "%20"', () => {
+ expect(urlUtils.mergeUrlParams({ ref: 'bogus' }, '?a=lorem+ipsum&ref=charlie')).toBe(
+ '?a=lorem%20ipsum&ref=bogus',
+ );
+ });
});
describe('removeParams', () => {