Skip to content

Percent encoding of query string parameters #64730

@avanigupta

Description

@avanigupta

My service uses the following APIs to add URL query strings:
QueryHelpers.AddQueryString and QueryBuilder.Add

According to RFC 3986, I'm expecting all the reserved characters to be percent-encoded. But I notice that the following characters are not encoded:

@!$()*,;

In comparison, all reserved characters are being encoded by .NET Core Uri.EscapeDataString API. Why is the behavior different in aspnetcore?

QueryBuilder.Add
Image

QueryHelpers.AddQueryString
Image

Uri.EscapeDataString
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions