redirect: add support to specify response code#2030
Merged
mattklein123 merged 4 commits intomasterfrom Nov 9, 2017
Merged
Conversation
Signed-off-by: Constance Caramanolis <ccaramanolis@lyft.com>
Signed-off-by: Constance Caramanolis <ccaramanolis@lyft.com>
mattklein123
reviewed
Nov 9, 2017
Member
mattklein123
left a comment
There was a problem hiding this comment.
thanks, few small comments
source/common/http/utility.h
Outdated
| * Send a redirect response. | ||
| * @param callbacks supplies the filter callbacks to use. | ||
| * @param new_path supplies the redirect target. | ||
| * @param status_code supplies the response code to use. |
Member
There was a problem hiding this comment.
nit: status_code vs. response_code below
| return matches; | ||
| } | ||
|
|
||
| Http::Code ConfigUtility::parseRedirectResponseCode( |
Member
There was a problem hiding this comment.
please make sure you have coverage over all of this. There should be some tests in config_impl_test.
Contributor
Author
There was a problem hiding this comment.
Added a test case in config_impl_test.cc
Member
There was a problem hiding this comment.
You need an actual test that loads a route table, gets the route, and makes sure a code is set. You don't have any test to make sure that that part is working. This should be in config_impl_test also. This may require converting one of the tests over to v2 YAML like we have been doing lately in other tests.
Signed-off-by: Constance Caramanolis <ccaramanolis@lyft.com>
danielhochman
previously approved these changes
Nov 9, 2017
Signed-off-by: Constance Caramanolis <ccaramanolis@lyft.com>
mattklein123
approved these changes
Nov 9, 2017
jpsim
added a commit
that referenced
this pull request
Nov 28, 2022
The patch is no longer needed as it was similarly patched upstream in nlohmann/json#3101. That patch was then shipped in v3.10.5, which is the version used in Envoy now. Signed-off-by: JP Simard <jp@jpsim.com>
jpsim
added a commit
that referenced
this pull request
Nov 29, 2022
The patch is no longer needed as it was similarly patched upstream in nlohmann/json#3101. That patch was then shipped in v3.10.5, which is the version used in Envoy now. Signed-off-by: JP Simard <jp@jpsim.com>
This file contains hidden or 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
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.
This PR allows for redirect actions to specify which HTTP Status code to return.
Consuming the enums created in envoyproxy/data-plane-api#225
Risk Level: Low
Testing: Unit Test
Signed-off-by: Constance Caramanolis ccaramanolis@lyft.com