Adds spec for 'hex-all' mode

bug/bundler_fix
Jeff Jarmoc 2014-05-12 12:01:06 -05:00
parent 5f523e8a04
commit cba39a9a04
1 changed files with 15 additions and 0 deletions

View File

@ -189,6 +189,7 @@ describe Rex::Proto::Http::ClientRequest do
'foo[]' => 'bar',
'bar' => 'baz',
'frobnicate' => 'the froozle?',
'foshizzle' => 'my/nizzle',
}
end
@ -215,6 +216,7 @@ describe Rex::Proto::Http::ClientRequest do
str.should include("foo[]=bar")
str.should include("bar=baz")
str.should include("frobnicate=the froozle?")
str.should include("foshizzle=my/nizzle")
end
end
@ -226,6 +228,7 @@ describe Rex::Proto::Http::ClientRequest do
str.should include("foo%5b%5d=bar")
str.should include("bar=baz")
str.should include("frobnicate=the%20froozle%3f")
str.should include("foshizzle=my/nizzle")
end
end
@ -236,6 +239,18 @@ describe Rex::Proto::Http::ClientRequest do
str.should include("%66%6f%6f%5b%5d=%62%61%72")
str.should include("%62%61%72=%62%61%7a")
str.should include("%66%72%6f%62%6e%69%63%61%74%65=%74%68%65%20%66%72%6f%6f%7a%6c%65%3f")
str.should include("%66%6f%73%68%69%7a%7a%6c%65=%6d%79/%6e%69%7a%7a%6c%65")
end
end
context "and 'uri_encode_mode' = hex-all" do
let(:encode_mode) { 'hex-all' }
it "should encode all chars" do
str = client_request.to_s
str.should include("%66%6f%6f%5b%5d%3d%62%61%72")
str.should include("%62%61%72%3d%62%61%7a")
str.should include("%66%72%6f%62%6e%69%63%61%74%65%3d%74%68%65%20%66%72%6f%6f%7a%6c%65%3f")
str.should include("%66%6f%73%68%69%7a%7a%6c%65%3d%6d%79%2f%6e%69%7a%7a%6c%65")
end
end