URLs being escaped after upgrade to 0.5.3 #166

Closed
KidkArolis opened this Issue Mar 4, 2013 · 4 comments

Comments

Projects
None yet
5 participants

Our PDF generation broke after update to 0.5.3

The URL we're opening is something like

PDFKit.new("http://localhost/?some_param=1", {})

In 0.5.3, that URL is converted to something like (I checked in the server's access log):

http://localhost/\?some_param=1

and the request fails.

0xCCD commented Mar 8, 2013

Same problem, 0.5.3 shattered my header and footer,

kit = PDFKit.new(html, :"header-html"=>newsletter_pdf_header_url(@newsletter), :"footer-html"=>newsletter_pdf_footer_url(@newsletter))

Url looks like
/newsletters/7132/pdf/header%5C
instead of
/newsletters/7132/pdf/header

glampr commented Apr 23, 2013

I have the same issue.
I try to turn this URL into a pdf

http://127.0.0.1:3001/el/users/524.print?to=pdf

but this is what I get in the server logs

Started GET "/el/users/524.print%5C?to%5C=pdf"

0xCCD commented Apr 23, 2013

For me i've solved it with

gem 'pdfkit', '=0.5.2'

sigmavirus24 removed the ready label Nov 4, 2014

Contributor

cdwort commented Jul 7, 2015

I believe this is related to #164, which lead to this commit: ce37ffc

We are now using shelljoin instead of shellescape, but I imagine the issue may still remain.

@cdwort cdwort added a commit to cdwort/pdfkit that referenced this issue Jul 7, 2015

@cdwort cdwort Do not shellescape URLs since it borks params (#166) a8fa318

cdwort was assigned by sigmavirus24 Jul 7, 2015

sigmavirus24 added the ready label Jul 7, 2015

cdwort added the escaping label Jul 8, 2015

@cdwort cdwort modified the milestone: 0.8.1 Jul 8, 2015

@cdwort cdwort added a commit to cdwort/pdfkit that referenced this issue Jul 12, 2015

@cdwort @cdwort cdwort + cdwort Do not shellescape URLs since it borks params (#166) 30d7b36

cdwort closed this in #312 Jul 16, 2015

sigmavirus24 removed the ready label Jul 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment