-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.
Milestone
Description
We have some logic that detects a UriHelper.NavigateTo call during prerendering, and is meant to turn it into a 302 redirection. However, trying to use this surfaced several problems:
- It doesn't work if you try to redirect to the homepage (i.e., the base-relative URL is the empty string). I guess it's because the server-side ASP.NET Core APIs don't work in terms of base-relative URLs. Our code already knows the
_baseUriStringat that point in the flow, so we could fix this by callingToAbsoluteUriand passing the result to theNavigationException. - For some reason, it logs the
NavigationExceptionto the console, even though our own code handles this and isn't meant to treat it as an error - For some reason, there's an almost 1 second delay before the redirection occurs. I determined this by disabling JS in my browser and trying to navigate to a component whose OnInit looks like this:
protected override void OnInit()
{
UriHelper.NavigateTo("greeter");
}The browser's network tab shows the response time as ~ 1 second, even though it would be near instant if I was not redirecting to another place.
Metadata
Metadata
Assignees
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.