forked from pdfkit/pdfkit
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bring up to speed with base #1
Open
jbosse
wants to merge
86
commits into
ARPC:master
Choose a base branch
from
pdfkit:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On my machine, this spec fails a bit more than half the time: it requests the one filetype, and gets the other content-type header. Many thanks to @treznick for the bones of this spec, even though it turned out a bit differently in the end.
This is a minimal fix. A more thorough fix might refactor the internals of `#call` and its helpers to not rely on instance variables or mutable state, but that would make it harder to tell whether threadsaftey, or some other change, was the real bug. This fix is borrowed from ContinuityControl@7c183c7 For more info, read: * https://ieftimov.com/writing-rails-middleware#thread-safety * http://stackoverflow.com/questions/23028226/rack-middleware-and-thread-safety Fixes #358.
The spec seems to be testing that the middleware's `@render_pdf` is reset after each request. The spec now fails, because all of the middleware's instance variables are, from the outside, irrelevant: they only matter for the `dup` instance, which is GC'd right away. I never like to delete a spec that starts to fail after a refactoring, but I think it's OK here, because: * the behavior the spec looks for is ensured by the threadsafety spec I added * this spec exemplifies the problem with rack middleware: relying on mutable state
Allow PDFKit middleware to receive javascript delay option
Missing version bump
Xvfb support
…eadme Remove `config.protocol` from the README.
* Remove support for Ruby < 2.2 * Add new wkhtmltopdf package for Travis build * Version bump * Add CHANGELOG notes
Update activesupport, remove Ruby 1.9.2 compatibility
Make PDFkit threadsafe
Version bump for bug fixes
Allows users to catch one error which all PDFkit errors are subclasses of
Update to wkhtmltopdf-binary-edge as wkhtmltopdf-binary gem is deprecated
Add missing require statements for tempfile
Only grab last line of bundle exec which output
Return 500 status when an exception is caught in middleware
* Update download url for wkhtmltopdf
* Version bump to 0.8.4.3
Limits the handling of exceptions to those occurring in the PDF generation logic, handling errors from @app.call(env) has the side-effect of burying errors which may be raised legitimately by other middlewares.
* Add github action to automatically draft release notes * Fix release drafter action
* Drop legacy Ruby versions They are currently unmaintained. * Run CI against multiple Rails versions * Add failing spec on Rails 6.0 * Use `ActiveSupport::SafeBuffer#html_safe` if it is available PDFKit concats HTML. So, it should not be escaped. * Document supported versions Now, pdfkit supports Ruby 2.5 or later.
This allows fature detection in application code. - Before ``` $ ruby -I ./lib -r pdfkit -e 'puts PDFKit::VERSION' Traceback (most recent call last): -e:1:in `<main>': uninitialized constant PDFKit::VERSION (NameError) ``` - After ``` $ ruby -I ./lib -r pdfkit -e 'puts PDFKit::VERSION' 0.8.4.3.2 ```
* Version bump to 0.8.5
* Initial commit * Update wkhtmltopdf setup * Build against multiple Rails versions * Add Ruby 2.5
- Update default ruby version to latest 2.6 release. - Test Ruby 2.7, 3.0, and 3.1, and Rails 6.1 and 7.0. Use versions as strings to make sure 3.0 tests 3.0. - Use latest rubygems and bundler to fix the bundler cache. - Exclude incompatible test matrix combinations. - Show Ruby deprecation warnings in tests where supported. - File.exists? is deprecated; use File.exist?. - URI.escape and URI.decode are deprecated. - Add frozen string literal comments. - Make sure constants are frozen. - Make sure that the code is frozen-string safe. - Adjust dev dependencies for Ruby 3.0+ compatibility. - Fix Ruby warnings in pdfkit_spec.rb - Comment out bad syntax in release-drafter action. Fixes #498
* fix: support non-lower-case Content-Type header provided by app The changes in #511 change what headers get set by PDFKit and make all headers set by PDFKit lower-case. However, the changes also affect code depending on headers set by the app - which for Rack 2.x apps will be 'Content-Type'. To address this, the code should check if Content-Type is present and in that case use it, otherwise default to content-type. As the code also sets this header (changing the content type to 'application/pdf'), it should set the same header that the original value is retrieved from. So decide on the exact header name first, store it in the 'content_type_header' variable, and use it to index the headers dict. Fix #515. * rspec: add tests for mixed case Content-Type header support As rack 3.x outright rejects mixed case headers, this test has to be marked as pending - but passes (without the pending flag) with rack 2.x. * rspec/content-type: make mixed case test pending only on Rack>=3.0.0
* By calling `IO.popen` with an Array of command arguments (ex: `['ls', '-l', ...]`) it runs the command as a separate process instead of running it in a sub-shell as a shell command. This prevents any arbitrary command injection or env variable interpolation, without needing complex shell-escaping logic. https://ruby-doc.org/core-3.1.2/IO.html#method-c-popen * Changed `Configuration#executable` to return a String or an Array for when xvfb mode is enabled. * Changed `PDFKit#command` to return an Array of command arguments for `IO.popen`. * Removed argument quoting logic as it's not necessary when calling `IO.popen` with an Array of arguments. * Rewrote some specs to test if the command's Array of arguments contains specific argument values. * Added a custom RSpec `contain` matcher for testing if an expected Array exists within another Array.
* use another complex key example * check if build issue is a corrupted cache problem? * Revert "check if build issue is a corrupted cache problem?" This reverts commit 77c075b. * swap to default rubygem to avoid 2.5 version issue * did i break the cache again? * Revert "did i break the cache again?" This reverts commit c3fcf24. * config runner to grab valid rubygem-update for 2.5 * jankessay
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.