Skip to content

feat: New method DownloadResponse::inline() - #7207

Merged
kenjis merged 4 commits into
codeigniter4:4.4from
iRedds:download-inline
Feb 4, 2023
Merged

kenjis merged 4 commits into
codeigniter4:4.4from
iRedds:download-inline

Conversation

@iRedds

@iRedds iRedds commented Feb 1, 2023

Copy link
Copy Markdown
Collaborator

Description
There is currently no way to change the Content-Disposition header when downloading a file, as this header will be overwritten when generating headers in the DownloadResponse class.

This PR prevents the Content-Disposition header from being changed when generating headers if that header has already been set.
It also adds a DownloadRespone::inline() helper method that sets the Content-Disposition: inline header.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added 4.4 enhancement PRs that improve existing functionalities labels Feb 1, 2023

@datamweb datamweb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice feat!

Comment thread user_guide_src/source/outgoing/response.rst Outdated
Comment thread user_guide_src/source/changelogs/v4.4.0.rst
Comment thread user_guide_src/source/outgoing/response.rst
@kenjis

kenjis commented Feb 3, 2023

Copy link
Copy Markdown
Member

Thank you. This seems good. Please update the user guide a bit.

Comment thread user_guide_src/source/changelogs/v4.4.0.rst Outdated

@kenjis kenjis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kenjis
kenjis merged commit 3221b57 into codeigniter4:4.4 Feb 4, 2023
@iRedds
iRedds deleted the download-inline branch February 7, 2023 02:40
@kenjis kenjis changed the title Feature: New method DownloadResponse::inline() feat: New method DownloadResponse::inline() Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that improve existing functionalities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants