From c78dbb041d2695eb483debce331052e6efeaa158 Mon Sep 17 00:00:00 2001 From: Chris Sinjakli Date: Thu, 24 Nov 2022 00:31:34 +0000 Subject: [PATCH] Use lowercase response headers in Rack example Because HTTP/2 requires that headers are sent in lowercase, Rack has started validating that no header contains an uppercase letter. We were setting uppercase headers as that was a common convention in HTTP/1.1, where they were interpreted in a case-insensitive fashion. This change makes us compatible with Rack 3.0 without breaking compatibiility for older versions (not that it would matter for this example code). Signed-off-by: Chris Sinjakli --- examples/rack/config.ru | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/rack/config.ru b/examples/rack/config.ru index 4b36b777..e545444f 100755 --- a/examples/rack/config.ru +++ b/examples/rack/config.ru @@ -11,9 +11,9 @@ srand app = lambda do |_| case rand when 0..0.8 - [200, { 'Content-Type' => 'text/html' }, ['OK']] + [200, { 'content-type' => 'text/html' }, ['OK']] when 0.8..0.95 - [404, { 'Content-Type' => 'text/html' }, ['Not Found']] + [404, { 'content-type' => 'text/html' }, ['Not Found']] else raise NoMethodError, 'It is a bug!' end