mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
avoid warnings on 1.8.6, at least
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@625 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
parent
fd9a2271ff
commit
467fcb5d8b
2 changed files with 4 additions and 4 deletions
|
@ -431,7 +431,7 @@ module Mongrel
|
|||
|
||||
def initialize(pattern, replacement = nil, &block)
|
||||
unless replacement or block
|
||||
@replacement = pattern
|
||||
@pattern, @replacement = nil, pattern
|
||||
else
|
||||
@pattern, @replacement, @block = pattern, replacement, block
|
||||
end
|
||||
|
|
|
@ -78,14 +78,14 @@ class HandlersTest < Test::Unit::TestCase
|
|||
# test that no accept-encoding returns a non-deflated response
|
||||
req = h.get("/dumb")
|
||||
assert(
|
||||
!req.header['Content-Encoding'] ||
|
||||
!req.header['Content-Encoding'].include?('deflate'))
|
||||
!req['Content-Encoding'] ||
|
||||
!req['Content-Encoding'].include?('deflate'))
|
||||
assert_equal "test", req.body
|
||||
|
||||
req = h.get("/dumb", {"Accept-Encoding" => "deflate"})
|
||||
# -MAX_WBITS stops zlib from looking for a zlib header
|
||||
inflater = Zlib::Inflate.new(-Zlib::MAX_WBITS)
|
||||
assert req.header['Content-Encoding'].include?('deflate')
|
||||
assert req['Content-Encoding'].include?('deflate')
|
||||
assert_equal "test", inflater.inflate(req.body)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue