spec/request/parser_spec.rb in thin-0.7.1 vs spec/request/parser_spec.rb in thin-0.8.0

- old
+ new

@@ -152,6 +152,28 @@ request.body.rewind request.body.read.should == 'aye' end + it "should parse ie6 urls" do + %w(/some/random/path" + /some/random/path> + /some/random/path< + /we/love/you/ie6?q=<""> + /url?<="&>=" + /mal"formed"? + ).each do |path| + parser = HttpParser.new + req = {} + sorta_safe = %(GET #{path} HTTP/1.1\r\n\r\n) + nread = parser.execute(req, sorta_safe, 0) + + sorta_safe.size.should == nread + parser.should be_finished + parser.should_not have_error + end + end + + it "should fails on heders larger then MAX_HEADER" do + proc { R("GET / HTTP/1.1\r\nFoo: #{'X' * Request::MAX_HEADER}\r\n\r\n") }.should raise_error(InvalidRequest) + end end \ No newline at end of file