Skip to content

Redirect should encode URLs if it needs to #4919

Open
@miloush

Description

@miloush

All these issues are result of people trying to redirect to a URL that is not all ASCII. Resolution seems to be "you should have encoded your URL".

#2678
aspnet/Mvc#7701
aspnet/KestrelHttpServer#2508
aspnet/KestrelHttpServer#2296
aspnet/Security#1646
aspnet/HttpAbstractions#971
aspnet/Routing#513
aspnet/Mvc#7529
aspnet/HttpAbstractions#907
aspnet/Mvc#6609
#2106
madskristensen/Miniblog.Core#87
#37337 (unicode host)

However, the fact that the RedirectResult puts the URL into a HTTP header (which is the ultimate source of the issue) is an implementation detail that the caller cannot magically assume. It is therefore responsibility of e.g. RedirectResultExecutor to meet the requirements and ensure the URL is properly formatted in case it decides to use HTTP headers for redirection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected-mediumThis issue impacts approximately half of our customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbreaking-changeThis issue / pr will introduce a breaking change, when resolved / merged.enhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-routingseverity-minorThis label is used by an internal tool

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions