router: clean up the request port when redirecting http and https (#4832) (#4841)

When the redirect action changes the scheme (https_redirect or scheme_redirect), remove the default port if it is set in the request. I.e. if the request is http://192.168.0.1:80/path redirected to https, the resulting URI will be https://192.168.0.1/path.

Risk Level: Low
Testing:  unit and integration tests.
Docs Changes: the proto documentation.
Release Notes:

Signed-off-by: Nikolay Nikolaev <nnikolay@vmware.com>

Mirrored from https://github.com/envoyproxy/envoy @ 0f7120968e60da62feb59f00170078611dffc18a
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent d21393f2ca
commit bd64ec51f5
  1. 5
      envoy/api/v2/route/route.proto

@ -725,6 +725,11 @@ message RouteAction {
}
message RedirectAction {
// When the scheme redirection take place, the following rules apply:
// 1. If the source URI scheme is `http` and the port is explicitly
// set to `:80`, the port will be removed after the redirection
// 2. If the source URI scheme is `https` and the port is explicitly
// set to `:443`, the port will be removed after the redirection
oneof scheme_rewrite_specifier {
// The scheme portion of the URL will be swapped with "https".
bool https_redirect = 4;

Loading…
Cancel
Save