-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrading from Rails 6.0.3.6 to 6.1.3.1 causes PDF download trigger browser error: ERR_RESPONSE_HEADERS_TOO_BIG #971
Comments
Ok, I've bashed this about a bit, and it looks like it's a problem with behaviour introduced in rails/rails#39939 and then softened in rails/rails@c55e32e. TL;DR: set this in
...Or do something else to prevent the massive data URLs being added to the |
@mjtko Thank you for tracking this down! The latter commit you pointed to makes it look like you can call: <%= javascript_include_tag('something', defer: false) %> in at least the newest version of Rails. |
Yeah, unfortunately that doesn't seem like an option with I still feel like the fix is probably not to add the preload link header for
But this is probably a discussion to have on a Rails issue somewhere. :-) I don't think this is something that |
I had a quick glance at issues in the Rails repo and it looks like this PR might fix the problem (or at least hide it) in the next release of Rails. rails/rails#42056 It sounds like that fix still might cause a lot of data might be sent that doesn't need to be sent though. |
Just to update here, this issue now has a proposed fix in Rails: rails/rails#42197 I think this can be closed here, as it's not specific to |
For anyone impacted by this, you can set |
@byroot Thanks for your work on the fix (your multiple handles confused me!) and good thinking to make the last comment the workaround to save people having to read through the whole issue. The workaround is as follows (from #971 (comment) above): Set this in
(NB. |
Issue description
I used the render PDF option for my Rails app and all works well on version 6.0.3.6. I upgraded to Rails 6.1.3.1 and now all browsers throw the following error: ERR_RESPONSE_HEADERS_TOO_BIG. Note that I've done some investigating and it appears to be linked to my usages of <%= stylesheet_link_tag wicked_pdf_asset_base64("pdf") %>. I don't understand why that would suddenly be causing problems when upgrading to the new version of rails.
Expected or desired behavior
PDF should download as usual.
System specifications
wicked_pdf gem version (output of
cat Gemfile.lock | grep wicked_pdf
):1.4.0
wkhtmltopdf version (output of
wkhtmltopdf --version
):0.12.6
whtmltopdf provider gem and version if one is used:
platform/distribution and version (e.g. Windows 10 / Ubuntu 16.04 / Heroku cedar):
Doesn't apply.. error exists on Windows 10 edge/chrome, Ubuntu Chrome/Firefox
The text was updated successfully, but these errors were encountered: