Modified Rack::Request#port to respect HTTP_X_FORWARDED_HOST port information if available
Debugging should not change semantics of load path or require modification before loading the application
The application should be loaded prior to daemonization to prevent issues with chdir etc.
Rack::Server should accept :app and override :config.

Signed-off-by: raggi <jftucker@gmail.com>
Make ConditionalGet middleware respect HTTP specification.

The specification says if both IF_NONE_MATCH and IF_MODIFIED_SINCE are sent, both should match in order to return 304.

Signed-off-by: raggi <jftucker@gmail.com>
Rack::Etag should not set ETag if Last-Modified header is sent.

The HTTP specification says that if both Last-Modified and ETag are sent, both should be matched in other to check if a request is fresh or not. If Rack always set ETag, even if Last-Modified is sent, checking the freshness according to specification becomes non trivial, since I will always need the digested body response.

Signed-off-by: raggi <jftucker@gmail.com>
Remove unneeded monkey patch to Rack::File from Rack::Sendfile
ETag middleware should not be triggered in sendfile bodies.

Signed-off-by: raggi <jftucker@gmail.com>
Update docs and minor corrections.
Make a few changes to the session store:

* Provide :cookie_only as option and as default. If false, allows SID to be retrieved from GET/POST params;

* Do not send the cookie back to the client if session id did not change;

* Make Abstract::ID implementation more modular, allowing Cookie implementation to be simpler by inheriting from it;

Signed-off-by: raggi <jftucker@gmail.com>
Refactor session stores by providing a with_lock helper and by moving the responsitility to handle :renew and :drop up to Abstract::ID.

Signed-off-by: raggi <jftucker@gmail.com>
Should set ETag only if status is 200 or 201.

Signed-off-by: raggi <jftucker@gmail.com>
Alias Response#to_ary to #finish for implicit-splat in Ruby 1.9.2.

* In Ruby 1.9.2 #to_ary is required for implicit-splat.
  http://redmine.ruby-lang.org/issues/show/1393

Signed-off-by: raggi <jftucker@gmail.com>
Make ShowExceptions respond with plain text on AJAX calls.

Signed-off-by: raggi <jftucker@gmail.com>
updated escape_html to use hex entities and to escape forward slash
Small merge work required.

Signed-off-by: raggi <jftucker@gmail.com>
Ensure the HTTP Cache-Control is set in the Etag middleware if none was given. It is extremally important to mark these responses as private by default.
memcache raises a RuntimeError on 1.9.2p0, too
return array instead of string as request body, so it works on 1.9
Avoid failing tests on platforms that do not support fork (JRuby/Windows). Relies on fork raising a NotImplementedError on those platforms, which both MRI and JRuby do.
Skip Rack::Lint::InputWrapper serialization in TestRequest. Makes tests pass on Ruby 1.9.1p378.