File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,12 @@ def to_s
102102
103103 private
104104
105+ # Format timestamps for the 'Expires' portion of the cookie string, as per RFC 2822 and 2616.
106+ #
107+ # @see https://www.rfc-editor.org/rfc/rfc2616#section-3.3.1
108+ # @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires
105109 def rfc2822 ( time )
106- wday = Time ::RFC2822_DAY_NAME [ time . wday ]
107- mon = Time ::RFC2822_MONTH_NAME [ time . mon - 1 ]
108- time . strftime ( "#{ wday } , %d-#{ mon } -%Y %H:%M:%S GMT" )
110+ time . strftime ( '%a, %d %b %Y %T GMT' )
109111 end
110112
111113 if URI . respond_to? ( :decode_www_form_component ) and defined? ( ::Encoding )
Original file line number Diff line number Diff line change 6060 expect ( str ) . to include "Path=/"
6161 expect ( str ) . to include "Version=1"
6262 expect ( str ) . to include "Max-Age=60"
63- expect ( str ) . to include "Expires=Sun, 14- Mar- 2010 03:14:00 GMT"
63+ expect ( str ) . to include "Expires=Sun, 14 Mar 2010 03:14:00 GMT"
6464 end
6565 end
6666 end
You can’t perform that action at this time.
0 commit comments