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

Fix form actions for apps deployed behind reverse proxy #51403

Merged
merged 3 commits into from
Oct 16, 2023

Conversation

SteveSandersonMS
Copy link
Member

@SteveSandersonMS SteveSandersonMS commented Oct 16, 2023

Fix form actions for apps deployed behind reverse proxy

Makes forms work for apps deployed behind a reverse proxy.

Description

Apps deployed behind a reverse proxy (e.g., container apps) should not try to emit absolute URLs by default because the scheme/hostname/port may differ from what is reachable from the outside world. The fix is to emit root-relative URLs.

Fixes #51380

Customer Impact

Without this fix, apps deployed behind a reverse proxy (e.g., in ACA) would not support form posts.

Regression?

  • Yes
  • No

No because this only affects SSR forms, which is a new feature in .NET 8.

Risk

  • High
  • Medium
  • Low

Low because this is only a change to how we generate the URL for a form's action attribute. Previously we used an absolute URL, but now we use a root-relative one. There is no other runtime change. Everything else in this PR is extra tests and updating existing tests.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@SteveSandersonMS SteveSandersonMS marked this pull request as ready for review October 16, 2023 12:06
@SteveSandersonMS SteveSandersonMS requested a review from a team as a code owner October 16, 2023 12:06
@SteveSandersonMS SteveSandersonMS added the Servicing-consider Shiproom approval is required for the issue label Oct 16, 2023
@ghost
Copy link

ghost commented Oct 16, 2023

Hi @SteveSandersonMS. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

@SteveSandersonMS SteveSandersonMS changed the title Fix form actions (return root relative URL) Fix form actions for apps deployed behind reverse proxy Oct 16, 2023
Copy link
Member

@mkArtakMSFT mkArtakMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @SteveSandersonMS !

@mkArtakMSFT mkArtakMSFT added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Oct 16, 2023
@ghost
Copy link

ghost commented Oct 16, 2023

Hi @SteveSandersonMS. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

@mkArtakMSFT mkArtakMSFT merged commit 02bdf70 into release/8.0 Oct 16, 2023
26 checks passed
@mkArtakMSFT mkArtakMSFT deleted the stevesa/fix-form-actions-root-relative branch October 16, 2023 17:40
@ghost ghost added this to the 8.0.0 milestone Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants