Skip to content
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

Add react router sample #479

Merged
merged 2 commits into from
Dec 18, 2017
Merged

Conversation

dustinsoftware
Copy link
Member

No description provided.

@dustinsoftware
Copy link
Member Author

Fixes #476

Copy link
Member

@Daniel15 Daniel15 left a 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.

@@ -123,7 +123,7 @@ var reactComponent

var executionResult = reactComponent.RenderRouterWithContext(clientOnly, serverOnly);

if (executionResult.Context?.status != null)
if (executionResult.Context?.status != null || executionResult.Context?.url != null)
Copy link
Member

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?

Copy link
Member Author

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

@@ -36,7 +36,7 @@ public static class SetServerResponse
/// <param name="Response">The response object to use.</param>
public static void ModifyResponse(RoutingContext context, HttpResponse Response)
{
var statusCode = context.status.Value;
var statusCode = context.status ?? 302;
Copy link
Member

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?

Copy link
Member Author

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

@Daniel15 Daniel15 merged commit 5dfcd37 into reactjs:master Dec 18, 2017
@Daniel15
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants