From 456c227979bfe947c3e0f0cebf4215c427ba7503 Mon Sep 17 00:00:00 2001 From: Kensuke Nagae Date: Mon, 10 Aug 2020 17:02:34 +0900 Subject: [PATCH] Use `Time#httpdate` instead of `Time#rfc822` `Time#rfc822` (alias of `Time#rfc2822`) represents time zone as `[+-]hhmm` format. While `Time#httpdate` represents time zone as `GMT` always, which is preferable as HTTP Date header format. - https://tools.ietf.org/html/rfc2616#section-3.3 - https://tools.ietf.org/html/rfc7231#section-7.1.1.2 - https://ruby-doc.org/stdlib-2.7.1/libdoc/time/rdoc/Time.html#method-i-httpdate - https://ruby-doc.org/stdlib-2.7.1/libdoc/time/rdoc/Time.html#method-i-rfc2822 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f37466..0c6f5b7 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ require "time" message = Net::HTTP::Get.new( "/path?query=123", - "Date" => Time.now.rfc822, + "Date" => Time.now.httpdate, "Content-Length" => "0", ) ```