Skip to content

[Bug]: Hard coded Content-Type in example MyAssetController class for asset protection #38

@elbkapitaenehh

Description

@elbkapitaenehh

Expected behavior

A protected asset should be delivered with the correct Content-Type header after one included the example code for the MyAssetController class from https://pimcore.com/docs/pimcore/10.6/Development_Documentation/Assets/Restricting_Public_Asset_Access.html#page_Option-2-Checking-permissions-before-delivery

Actual behavior

The Content-Type header is hard coded as application/pdf. It should be $asset->getMimeType() in order to match the delivered asset MimeType

Steps to reproduce

  1. Implement the solution documented in https://pimcore.com/docs/pimcore/10.6/Development_Documentation/Assets/Restricting_Public_Asset_Access.html#page_Option-2-Checking-permissions-before-delivery
  2. Upload any non-pdf asset in the protected folder
  3. Authenticate and open the public link
  4. The Content-Type says 'application/pdf'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions