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

Conversation

Projects
None yet
2 participants
@dustinsoftware
Collaborator

dustinsoftware commented Nov 23, 2017

No description provided.

@dustinsoftware dustinsoftware force-pushed the dustinsoftware:add-rr-sample branch from 0e9f5bf to b6ff9e4 Nov 23, 2017

@dustinsoftware

This comment has been minimized.

Collaborator

dustinsoftware commented Nov 23, 2017

Fixes #476

@Daniel15

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)

This comment has been minimized.

@Daniel15

Daniel15 Dec 11, 2017

Member

Why is this change needed?

This comment has been minimized.

@dustinsoftware

dustinsoftware Dec 18, 2017

Collaborator

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;

This comment has been minimized.

@Daniel15

Daniel15 Dec 11, 2017

Member

Why is this change needed?

This comment has been minimized.

@dustinsoftware

dustinsoftware Dec 18, 2017

Collaborator

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

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@Daniel15

This comment has been minimized.

Member

Daniel15 commented Dec 18, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment