Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add http 1.1 spec test for missing content-length response (#168)

  • Loading branch information...
commit e7beb1b2330f4466853ec08446b2225961fee484 1 parent b544d55
@igrigorik authored
Showing with 17 additions and 1 deletion.
  1. +17 −1 spec/client_spec.rb
View
18 spec/client_spec.rb
@@ -632,6 +632,22 @@ def failed(http=nil)
}
end
+ it "should get the body without Content-Length" do
+ EventMachine.run {
+ @s = StubServer.new("HTTP/1.1 200 OK\r\n\r\nFoo")
+
+ http = EventMachine::HttpRequest.new('http://127.0.0.1:8081/').get
+ http.errback { failed(http) }
+ http.callback {
+ http.response.should match(/Foo/)
+ http.response_header['CONTENT_LENGTH'].should be_nil
+
+ @s.stop
+ EventMachine.stop
+ }
+ }
+ end
+
context "when talking to a stub HTTP/1.0 server" do
it "should get the body without Content-Length" do
@@ -642,7 +658,7 @@ def failed(http=nil)
http.errback { failed(http) }
http.callback {
http.response.should match(/Foo/)
- http.response_header['CONTENT_LENGTH'].should_not == 0
+ http.response_header['CONTENT_LENGTH'].should be_nil
@s.stop
EventMachine.stop
Please sign in to comment.
Something went wrong with that request. Please try again.