-
Notifications
You must be signed in to change notification settings - Fork 916
Add react router sample #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0e9f5bf to
b6ff9e4
Compare
|
Fixes #476 |
Daniel15
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems pretty good, I just have some comments inline.
| var executionResult = reactComponent.RenderRouterWithContext(clientOnly, serverOnly); | ||
|
|
||
| if (executionResult.Context?.status != null) | ||
| if (executionResult.Context?.status != null || executionResult.Context?.url != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible for a redirect to be returned without a status code defined
| public static void ModifyResponse(RoutingContext context, HttpResponse Response) | ||
| { | ||
| var statusCode = context.status.Value; | ||
| var statusCode = context.status ?? 302; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a status code is omitted we can't know if the author intended a permanent or temporary redirect, therefore it's safest to assume temporary
|
Thanks! |
No description provided.