Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support non-lower-case Content-Type header provided by app (#516)
* 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
- Loading branch information