Skip to content

Commit

Permalink
Add test to show the truncation of response source with a null byte
Browse files Browse the repository at this point in the history
  • Loading branch information
danivovich committed Apr 18, 2012
1 parent 1ef8f4c commit 4e47ea9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/driver_spec.rb
Expand Up @@ -1500,4 +1500,19 @@ def which_for(character)

it_behaves_like "a keyupdown app"
end

context "null byte app" do
before(:all) do
@app = lambda do |env|
body = "Hello\0World"
[200,
{ 'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s },
[body]]
end
end

it "should include all the bytes in the source" do
subject.source.should == "Hello\0World"
end
end
end

0 comments on commit 4e47ea9

Please sign in to comment.