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

fix: support non-lower-case Content-Type header provided by app #516

Merged
merged 3 commits into from
Oct 12, 2022
Merged

fix: support non-lower-case Content-Type header provided by app #516

merged 3 commits into from
Oct 12, 2022

Commits on Oct 6, 2022

  1. 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.
    vladimir-mencl-eresearch committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    946f71f View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2022

  1. 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.
    vladimir-mencl-eresearch committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    8ba8d6e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6b4f50f View commit details
    Browse the repository at this point in the history