Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Prefer the new encoders over Uri.EscapeDataString #161

@GrabYourPitchforks

Description

@GrabYourPitchforks

There are some call sites in this repo that invoke Uri.EscapeDataString. Instead of calling this static API, the caller should make an effort to use the IUrlEncoder that has been configured by the application developer, as it could have more permissive or restrictive logic than that of Uri.EscapeDataString.

If you have access to an IServiceProvider instance, import the Microsoft.AspNet.WebUtilities.Encoders namespace (in the Microsoft.AspNet.Http.Extensions package) and call the IServiceProvider.GetUrlEncoder() extension method

If you do not have access to an IServiceProvider, you can get a default static singleton instance of an IUrlEncoder via the UrlEncoder.Default static property (namespace Microsoft.AspNet.WebUtilities.Encoders, project Microsoft.AspNet.WebUtilities).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions