-
Notifications
You must be signed in to change notification settings - Fork 96
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 logic for defining port in redirect based on scheme #801
Merged
ciarams87
merged 3 commits into
nginxinc:main
from
ciarams87:fix/incorrect-port-scheme-redirect
Jul 6, 2023
Merged
Add logic for defining port in redirect based on scheme #801
ciarams87
merged 3 commits into
nginxinc:main
from
ciarams87:fix/incorrect-port-scheme-redirect
Jul 6, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pleshakov
reviewed
Jun 28, 2023
sjberman
reviewed
Jun 28, 2023
ciarams87
force-pushed
the
fix/incorrect-port-scheme-redirect
branch
from
June 29, 2023 09:38
2f4f375
to
2739a2e
Compare
pleshakov
reviewed
Jun 29, 2023
pleshakov
reviewed
Jun 29, 2023
ciarams87
force-pushed
the
fix/incorrect-port-scheme-redirect
branch
from
June 30, 2023 09:55
b0769c3
to
8fe223a
Compare
pleshakov
approved these changes
Jun 30, 2023
ciarams87
force-pushed
the
fix/incorrect-port-scheme-redirect
branch
from
July 3, 2023 08:43
8fe223a
to
bd644e0
Compare
kate-osborn
approved these changes
Jul 5, 2023
ciarams87
force-pushed
the
fix/incorrect-port-scheme-redirect
branch
from
July 6, 2023 10:32
bd644e0
to
a4e9fed
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
Problem: The port in the location header for an HTTPRoute with a requestRedirect filter must be set based on the rules in the spec
We're missing the case where scheme is set to a well-known (http or https) value, but no port is specified. In these cases, we should set the port in the redirect location to 80 for scheme==http, and 443 for scheme==https.
Additionally, when the port is the well known port associated with the scheme, we should not actually include the port in the redirect location. This means that we should ONLY include the port in the redirect url if the scheme is unset, or if the port is specified in the filter to something other than 80 or 443.
Solution: Remove the port in redirect location if it corresponds to the specified scheme.
Testing: Added unit-tests, confirmed the HTTPRouteRedirectScheme and HTTPRouteRedirectPortAndScheme conformance tests are now passing
Closes #795
Checklist
Before creating a PR, run through this checklist and mark each as complete.