From df8fb226597070611f248b90f032c1aa1a1b2572 Mon Sep 17 00:00:00 2001 From: Ciara Stacke Date: Tue, 30 Nov 2021 14:30:59 +0000 Subject: [PATCH] Explicitly add content-type header grpc errors --- internal/configs/version2/nginx-plus.virtualserver.tmpl | 7 +++++++ internal/configs/version2/nginx.virtualserver.tmpl | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/internal/configs/version2/nginx-plus.virtualserver.tmpl b/internal/configs/version2/nginx-plus.virtualserver.tmpl index 83a5e286ec..79b50dd057 100644 --- a/internal/configs/version2/nginx-plus.virtualserver.tmpl +++ b/internal/configs/version2/nginx-plus.virtualserver.tmpl @@ -447,6 +447,7 @@ server { {{ if $ssl.HTTP2 }} location @grpc_deadline_exceeded { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 4; add_header grpc-message 'deadline exceeded'; return 204; @@ -454,6 +455,7 @@ server { location @grpc_permission_denied { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 7; add_header grpc-message 'permission denied'; return 204; @@ -461,6 +463,7 @@ server { location @grpc_resource_exhausted { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 8; add_header grpc-message 'resource exhausted'; return 204; @@ -468,6 +471,7 @@ server { location @grpc_unimplemented { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 12; add_header grpc-message unimplemented; return 204; @@ -475,6 +479,7 @@ server { location @grpc_internal { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 13; add_header grpc-message 'internal error'; return 204; @@ -482,6 +487,7 @@ server { location @grpc_unavailable { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 14; add_header grpc-message unavailable; return 204; @@ -489,6 +495,7 @@ server { location @grpc_unauthenticated { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 16; add_header grpc-message unauthenticated; return 204; diff --git a/internal/configs/version2/nginx.virtualserver.tmpl b/internal/configs/version2/nginx.virtualserver.tmpl index a004d37228..58fc4d0c9c 100644 --- a/internal/configs/version2/nginx.virtualserver.tmpl +++ b/internal/configs/version2/nginx.virtualserver.tmpl @@ -342,6 +342,7 @@ server { {{ if $ssl.HTTP2 }} location @grpc_deadline_exceeded { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 4; add_header grpc-message 'deadline exceeded'; return 204; @@ -349,6 +350,7 @@ server { location @grpc_permission_denied { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 7; add_header grpc-message 'permission denied'; return 204; @@ -356,6 +358,7 @@ server { location @grpc_resource_exhausted { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 8; add_header grpc-message 'resource exhausted'; return 204; @@ -363,6 +366,7 @@ server { location @grpc_unimplemented { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 12; add_header grpc-message unimplemented; return 204; @@ -370,6 +374,7 @@ server { location @grpc_internal { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 13; add_header grpc-message 'internal error'; return 204; @@ -377,6 +382,7 @@ server { location @grpc_unavailable { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 14; add_header grpc-message unavailable; return 204; @@ -384,6 +390,7 @@ server { location @grpc_unauthenticated { default_type application/grpc; + add_header content-type application/grpc; add_header grpc-status 16; add_header grpc-message unauthenticated; return 204;