mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
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.
This commit is contained in:
parent
68e1ba07d3
commit
1f7d4089f9
2 changed files with 4 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue