<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,6 +3,7 @@ $:.unshift File.expand_path(File.dirname(__FILE__))
 require 'fileutils'
 require 'timeout'
 require 'stringio'
+require 'time'
 
 require 'rubygems'
 require 'eventmachine'</diff>
      <filename>lib/thin.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,14 @@ module Thin
     def []=(key, value)
       if !@sent.has_key?(key) || ALLOWED_DUPLICATES.include?(key)
         @sent[key] = true
+        value = case value
+                when Time
+                  value.rfc822
+                when NilClass
+                  return
+                else
+                  value.to_s
+                end
         @out &lt;&lt; HEADER_FORMAT % [key, value]
       end
     end</diff>
      <filename>lib/thin/headers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -26,4 +26,15 @@ describe Headers do
     
     @headers.to_s.should == &quot;Host: localhost:3000\r\nSet-Cookie: twice\r\nSet-Cookie: is cooler the once\r\n&quot;
   end
+
+  it 'should ignore nil values' do
+    @headers['Something'] = nil
+    @headers.to_s.should_not include('Something: ')
+  end
+
+  it 'should format Time values correctly' do
+    time = Time.now
+    @headers['Modified-At'] = time
+    @headers.to_s.should include(&quot;Modified-At: #{time.rfc822}&quot;)
+  end
 end
\ No newline at end of file</diff>
      <filename>spec/headers_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b9ec90108045101501a436cb124599d4a70fcbdb</id>
    </parent>
  </parents>
  <author>
    <name>Aman Gupta</name>
    <email>aman@tmm1.net</email>
  </author>
  <url>http://github.com/macournoyer/thin/commit/a8a71b8770bcefe38daecd3be903846084c60051</url>
  <id>a8a71b8770bcefe38daecd3be903846084c60051</id>
  <committed-date>2008-07-25T12:39:11-07:00</committed-date>
  <authored-date>2008-07-25T12:39:11-07:00</authored-date>
  <message>Handle nil and Time header values correctly</message>
  <tree>890f503c21248114c1697bf530eb3e3ab3268657</tree>
  <committer>
    <name>Aman Gupta</name>
    <email>aman@tmm1.net</email>
  </committer>
</commit>
