spec/source_spec.rb in pdfkit-0.8.6 vs spec/source_spec.rb in pdfkit-0.8.7
- old
+ new
@@ -78,9 +78,14 @@
it "URI escapes source URLs and encloses them in quotes to accomodate ampersands" do
source = PDFKit::Source.new("https://www.google.com/search?q='cat<dev/zero>/dev/null'")
expect(source.to_input_for_command).to eq "\"https://www.google.com/search?q='cat%3Cdev/zero%3E/dev/null'\""
end
+ it "URI escapes source URI only escape part of it" do
+ source = PDFKit::Source.new("https://www.google.com/search?q='%20 sleep 5'")
+ expect(source.to_input_for_command).to eq "\"https://www.google.com/search?q='%2520%20sleep%205'\""
+ end
+
it "does not URI escape previously escaped source URLs" do
source = PDFKit::Source.new("https://www.google.com/search?q='cat%3Cdev/zero%3E/dev/null'")
expect(source.to_input_for_command).to eq "\"https://www.google.com/search?q='cat%3Cdev/zero%3E/dev/null'\""
end