lib/pdfkit/middleware.rb in pdfkit-0.4.5 vs lib/pdfkit/middleware.rb in pdfkit-0.4.6

- old
+ new

@@ -40,12 +40,10 @@ # Change relative paths to absolute def translate_paths(body, env) # Host with protocol root = env['rack.url_scheme'] + "://" + env['HTTP_HOST'] + "/" - body.gsub!(/(href|src)=(['"])\/([^\"']*|[^"']*)['"]/,'\1=\2'+root+'\3\2') - - return body + body.gsub(/(href|src)=(['"])\/([^\"']*|[^"']*)['"]/,'\1=\2'+root+'\3\2') end def set_request_to_render_as_pdf(env) @render_pdf = true