Skip to content

Url.modifyUrlParams doesn't preserve percent encoding of spaces #6153

@astlouisf

Description

@astlouisf

What version of Effect is running?

@effect/platform@0.96.0

What steps can reproduce the bug?

The issue is that Url.modifyUrlParams automatically changes %20 to + in query parameters, often time affecting parameters that are not the target of any modification.

in Node

const {Url} = await import("@effect/platform");
const identity = x => x;
const url = new URL("https://example.com?foo=bar%20baz");
const url2 = Url.modifyUrlParams(url, identity);
url.href === url2.href // false, but feels like it should be true

What is the expected behavior?

url2.href should preserve the percent encoding.

What do you see instead?

url2.href contain + rather than percent encoded spaces.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions