From cd01e0fee67f6706262996509284068d5c8176a6 Mon Sep 17 00:00:00 2001 From: ccaraman Date: Wed, 1 Nov 2017 10:52:22 -0700 Subject: [PATCH] redirect: allow to specify redirect response code (#217) * redirect: Add HTTP response codes. Signed-off-by: Constance Caramanolis --- api/rds.proto | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/api/rds.proto b/api/rds.proto index 6f85c967..fab5e2d4 100644 --- a/api/rds.proto +++ b/api/rds.proto @@ -285,12 +285,24 @@ message RouteAction { } message RedirectAction { - // A 302 redirect response will be sent which swaps the host portion of the - // URL with this value. + // The host portion of the URL will be swapped with this value. string host_redirect = 1; - // A 302 redirect response will be sent which swaps the path portion of the - // URL with this value. + // The path portion of the URL will be swapped with this value. string path_redirect = 2; + + enum RedirectResponseCode { + // Moved Permanently HTTP Status Code - 301. + MOVED_PERMANENTLY = 0; + // Found HTTP Status Code - 302. + FOUND = 1; + // See Other HTTP Status Code - 303. + SEE_OTHER = 2; + // Not Modified HTTP Status Code - 304. + NOT_MODIFIED = 3; + } + // The HTTP status code to use in the redirect response. The default response + // code is MOVED_PERMANENTLY (301). + RedirectResponseCode response_code = 3; } message Decorator { @@ -461,9 +473,9 @@ message VirtualHost { // No TLS requirement for the virtual host. NONE = 0; // External requests must use TLS. If a request is external and it is not - // using TLS, a 302 redirect will be sent telling the client to use HTTPS. + // using TLS, a 301 redirect will be sent telling the client to use HTTPS. EXTERNAL_ONLY = 1; - // All requests must use TLS. If a request is not using TLS, a 302 redirect + // All requests must use TLS. If a request is not using TLS, a 301 redirect // will be sent telling the client to use HTTPS. ALL = 2; }