yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* [PATCH] http_response: skip Date header case-insensitively
@ 2014-11-16  4:21 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2014-11-16  4:21 UTC (permalink / raw)
  To: yahns-public

HTTP headers are compared case-insensitively, so we must filter out
the Date header case-insensitively.  Found via casual code
inspection, I doubt anybody sets a Date header in Rack apps.
---
 lib/yahns/http_response.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/yahns/http_response.rb b/lib/yahns/http_response.rb
index 8965fd0..33ae93e 100644
--- a/lib/yahns/http_response.rb
+++ b/lib/yahns/http_response.rb
@@ -143,7 +143,7 @@ module Yahns::HttpResponse # :nodoc:
       buf = "#{response_start}#{status}\r\nDate: #{httpdate}\r\n"
       headers.each do |key, value|
         case key
-        when %r{\ADate\z}
+        when %r{\ADate\z}i
           next
         when %r{\AContent-Range\z}i
           if %r{\Abytes (\d+)-(\d+)/\d+\z} =~ value
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-11-16  4:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-16  4:21 [PATCH] http_response: skip Date header case-insensitively Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/yahns.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).