aspnet / BasicMiddleware

[Archived] Basic middleware components for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
169 stars 84 forks source link

Source querystring is not preserved for redirects when target doesn't have a querystring #188

Closed guardrex closed 7 years ago

guardrex commented 7 years ago

@bartmax found this at ...

https://github.com/aspnet/BasicMiddleware/blob/dev/src/Microsoft.AspNetCore.Rewrite/Internal/RedirectRule.cs#L81

@bartmax suggested for L81 ...

response.Headers[HeaderNames.Location] = 
    pathBase + newPath + context.HttpContext.Request.QueryString;

... to preserve it for the redirect when the newPath doesn't have one.

If you're wondering why he didn't open this, I asked him, and he responded in code ...

Lazy<Bart> bart => OpenIssue();

:smile:

muratg commented 7 years ago

@mikaelm12 could you investigate?

Bartmax commented 7 years ago

wohooo!! 👍