Skip to content
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

Remote asset returning non-200 response does not trigger an error #1092

Open
d4rky-pl opened this issue Jan 5, 2024 · 0 comments
Open

Remote asset returning non-200 response does not trigger an error #1092

d4rky-pl opened this issue Jan 5, 2024 · 0 comments

Comments

@d4rky-pl
Copy link
Contributor

d4rky-pl commented Jan 5, 2024

Issue description

When using wicked_pdf_stylesheet_link_tag, if the assets are precompiled or otherwise referenced via URL, WickedPDF tries to fetch the asset from remote URL using read_from_uri method in WickedPdf::WickedPdfHelper::Assets. This method calls Net::HTTP.get(URI(uri)) which does not fail if the status code is different than 200, resulting in a broken PDF if either the server responding to the request (for ex. 502 error) or the asset (404) is unavailable without ever informing the user.

Expected or desired behavior

If the remote asset is not available, WickedPDF should throw an exception. This could be configurable to avoid breaking change.

System specifications

wicked_pdf gem version: 2.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant