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

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

Merged
merged 4 commits into from
Feb 4, 2023

Conversation

iRedds
Copy link
Collaborator

@iRedds iRedds commented Feb 1, 2023

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
Copy link
Contributor

@datamweb datamweb left a comment

Choose a reason for hiding this comment

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

Nice feat!

@kenjis
Copy link
Member

kenjis commented Feb 3, 2023

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

Copy link
Member

@kenjis kenjis left a comment

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
4.4 enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants