From 1f7d4089f9125cec9fa0c0ada55a3d50a8cdfd0d Mon Sep 17 00:00:00 2001 From: Joel Chippindale Date: Mon, 17 Aug 2020 19:52:45 +0100 Subject: Fix handling of multiple spaces in URLSearchParams (#7068) This ensures that all spaces are set to be "+" in the string rather than just the first and brings deno into line with how browsers handle spaces in URLSearchParams, see #7001. --- cli/tests/unit/url_search_params_test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/tests') diff --git a/cli/tests/unit/url_search_params_test.ts b/cli/tests/unit/url_search_params_test.ts index 7698ef1ce..c20db56dd 100644 --- a/cli/tests/unit/url_search_params_test.ts +++ b/cli/tests/unit/url_search_params_test.ts @@ -1,10 +1,10 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { unitTest, assert, assertEquals } from "./test_util.ts"; -unitTest(function urlSearchParamsWithSpace(): void { - const init = { str: "hello world" }; +unitTest(function urlSearchParamsWithMultipleSpaces(): void { + const init = { str: "this string has spaces in it" }; const searchParams = new URLSearchParams(init).toString(); - assertEquals(searchParams, "str=hello+world"); + assertEquals(searchParams, "str=this+string+has+spaces+in+it"); }); unitTest(function urlSearchParamsWithExclamation(): void { -- cgit v1.2.3