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

[Bug]: Wrong mimetype gets attached to DNG files when downloading #49297

Open
4 tasks done
MrRinkana opened this issue Nov 14, 2024 · 1 comment
Open
4 tasks done

[Bug]: Wrong mimetype gets attached to DNG files when downloading #49297

MrRinkana opened this issue Nov 14, 2024 · 1 comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 29-feedback bug needs info

Comments

@MrRinkana
Copy link

MrRinkana commented Nov 14, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

When clicking to download ".DNG" files, the get request gets content-type: image/x-dcraw which is according to this is a general mimetype for raw files. On linux firefox only for some reason this results in the file getting the wrong extension of ".bay" instead of the ".DNG". I dont know why firefox prefers the contenttype over the content-disposition filename, and why only on linux (or maybe ff <=132.0.1?) and i guess that maybe is a firefox bug, but anyway the more specific mimetype for .DNG is image/x-adobe-dng

If you want to use the IANA standard then DNG files are not defined, and should have the content-type application/octet-stream. This is what the other sites I tried downloading the DNG file used, but I'd say theres not much harm in using "x-adobe-dng".

Originally I was about to create an issue with this: For some strange reason attempting to download ".DNG" files from both my main nc instance and a test-instance running AIO results in the file being downloaded but with the extension changed to ".bay". This seems to only occur on linux firefox (or firefox 132.0.1) **BUT the browser works fine (as in downloads .DNG files correctly) on all other sites I have tried**, including gdrive, ff-send, some random "uploadsite" I found in the search results, onedrive. Firefox working on all other sites is why Im creating the bug report here.

Steps to reproduce

  1. Create a empty file ending with .DNG or use existing .DNG image
  2. open the inspector to see the get request
  3. Click to download
  4. (maybe) observe .bay getting saved instead of .DNG, either way the content type is image/x-dcraw

.bay files are called "Digital raw image" by the dolphin (kde filemanager) window that asks me where to save the file. DNG are "Adobe DNG negative". See the gnome git linked above.

Expected behavior

  • That the file gets the content-type of image/x-adobe-dng or the IANA standard application/octet-stream
  • That the downloaded DNG file gets the correct extension as they seem to get on other sites, or in other browsers.

Nextcloud Server version

29.0.9 and 30.0.2 RC2 (AIO)

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated from a MINOR version (ex. 28.0.1 to 28.0.2)

Are you using the Nextcloud Server Encryption module?

None

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "10.10.10.32",
            "cloud.example.se"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "29.0.9.2",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/cloud.example.se\/",
        "overwriteprotocol": "https",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance_window_start": 2,
        "default_phone_region": "SE",
        "default_language": "sv",
        "default_locale": "sv_SE",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "loglevel": 2,
        "defaultapp": "",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "skeletondirectory": "\/srv\/www\/skelett\/",
        "templatedirectory": "",
        "enabledPreviewProviders": [
            "OC\\Preview\\Imaginary",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\MP3",
            "OC\\Preview\\Movie",
            "OC\\Preview\\MKV",
            "OC\\Preview\\MP4",
            "OC\\Preview\\AVI"
        ],
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "tempdirectory": "\/mnt\/ncdata\/php_tmpfiles\/",
        "maintenance": false,
        "theme": "",
        "memories.vod.path": "\/srv\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.vod.disable": false,
        "memories.gis_type": 1,
        "memories.db.triggers.fcu": true,
        "memories.exiftool_no_local": true
    }
}

List of activated Apps

Enabled:
  - activity: 2.21.1
  - announcementcenter: 7.0.1
  - calendar: 4.7.16
  - camerarawpreviews: 0.8.6
  - checksum: 1.2.5
  - circles: 29.0.0-dev
  - cloud_federation_api: 1.12.0
  - comments: 1.19.0
  - contacts: 6.0.1
  - contactsinteraction: 1.10.0
  - cospend: 1.6.1
  - dashboard: 7.9.0
  - dav: 1.30.1
  - federatedfilesharing: 1.19.0
  - federation: 1.19.0
  - files: 2.1.1
  - files_downloadlimit: 2.0.0
  - files_external: 1.21.0
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_sharing: 1.21.0
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - firstrunwizard: 2.18.0
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - memories: 7.4.1
  - metadata: 0.21.0
  - nextcloud_announcements: 1.18.0
  - notes: 4.11.0
  - notifications: 2.17.0
  - notify_push: 0.7.0
  - oauth2: 1.17.1
  - oidc: 1.0.0
  - password_policy: 1.19.0
  - phonetrack: 0.8.1
  - photos: 2.5.0
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - recommendations: 2.1.0
  - registration: 2.5.0
  - related_resources: 1.4.0
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - support: 1.12.0
  - survey_client: 1.17.0
  - systemtags: 1.19.0
  - text: 3.10.1
  - theming: 2.4.0
  - theming_customcss: 1.17.0
  - twofactor_backupcodes: 1.18.0
  - twofactor_totp: 11.0.0-dev
  - twofactor_webauthn: 1.4.0
  - updatenotification: 1.19.1
  - user_status: 1.9.0
  - viewer: 2.3.0
  - weather_status: 1.9.0
  - workflowengine: 2.11.0
Disabled:
  - admin_audit: 1.19.0
  - bruteforcesettings: 2.9.0
  - encryption: 2.17.0
  - suspicious_login: 7.0.0
  - user_ldap: 1.20.0

Nextcloud Signing status

No errors have been found.

Additional info

Tested:

  • Firefox 132.0.1 on kde plasma (openSUSE Tumbleweed, wayland): saves as .bay files from only nextcloud, other sites I have tried work fine.
  • Firefox 131.0.3 on kde plasma Tumbleweed, wayland but other machine works the same way, .bay in nc, .DNG on other sites.
  • Firefox 132.0.2 android, works as expected
  • ms edge on kde plasma (openSUSE Tumbleweed, wayland) works as expected
  • Firefox 132.0.2 on windows 11 works as expected

works as expected = saves as .DNG

@MrRinkana MrRinkana added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Nov 14, 2024
@solracsf
Copy link
Member

solracsf commented Nov 16, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 29-feedback bug needs info
Projects
None yet
Development

No branches or pull requests

3 participants