Commit Graph

10 Commits

Author SHA1 Message Date
Ryan Tomayko 98427cefa7 Better Content-Length handling for HEAD requests
Responses to HEAD requests _should_ have a Content-Length header
that's identical to GET requests. When a body is provided by the
application, set the Content-Length header to the size of the body
and replace the body with an empty Array; when no body is provided
by the application in response to a HEAD request, and the
Content-Length is calculated to be "0", remove the Content-Length
header entirely to avoid mis-matched values.

The idea here is that it's better to omit the header when we believe
the Content-Length is not indicative of the same in response to GET
than to send the Content-Length with a mismatched value. Logic
taken from Apache and is generally in line with RFC 2616.
2009-02-25 09:59:58 -08:00
Ryan Tomayko d4680f721b yield the MockRequest to the block before invoking the app [#111]
sr commented this out during some refactoring but I'd like
to leave it in for now.
2009-02-23 22:22:37 -08:00
Simon Rozet 9952b8d4ef Test for #head 2009-02-22 07:22:58 -08:00
Simon Rozet 596a972d3d Cosmetic change to test for #follow 2009-02-22 07:22:49 -08:00
Ryan Tomayko b398c1c83b require 'yaml' to fix specs under Ruby 1.9.1 2009-02-21 22:29:54 -08:00
Simon Rozet c011f2b571 Started test for Sinatra::Test 2009-02-21 22:27:18 -08:00
Simon Rozet 52658061d1 Support for nested params in Sinatra::Test
Sinatra::Test#param_string was slurped from merb:

<http://github.com/wycats/merb/blob/84f61f39/merb-core/lib/merb-core/dispatch/request_parsers.rb#L156>
2009-01-20 12:37:50 -08:00
Blake Mizerany 5e5f0c021a starting 2007-11-27 19:12:06 -08:00
Blake Mizerany c4849188a8 * can't find a way to test Test::Unit in isolation. Ignore tests for now.
* updated to_proc for correct __send__
2007-11-21 15:49:40 -08:00
Blake Mizerany 93e2f06848 * test test
* test 404 status returned when 404
2007-11-21 15:45:38 -08:00