Forum Discussion

Remers10's avatar
Remers10
New member | Level 2
3 years ago

Incorrect content type returned when downloading images from dl.dropboxusercontent.com

A content-type of "application/json" is returned whenever requesting a public image hosted by dropbox. I've tested with both a png and jpg

 

 

$ curl -I https://dl.dropboxusercontent.com/s/REDACTED/name.png?dl=1
HTTP/2 200
accept-ranges: bytes
cache-control: max-age=60
content-disposition: attachment; filename=name.png
content-security-policy: report-uri https://www.dropbox.com/csp_log?policy_name=blockserver-usercontent ; sandbox allow-forms allow-scripts allow-top-navigation allow-popups
content-security-policy: form-action 'none' ; report-uri https://www.dropbox.com/csp_log?policy_name=blockserver-noscript ; script-src 'none'
etag: REDACTED
pragma: public
set-cookie:  REDACTED; Domain=dropboxusercontent.com; HttpOnly; Path=/; SameSite=None; Secure
x-content-type-options: nosniff
x-server-response-time: 123
content-type: application/json
accept-encoding: identity,gzip
date: Mon, 03 Oct 2022 21:02:59 GMT
server: envoy
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-robots-tag: noindex, nofollow, noimageindex
content-length: REDACTED
vary: Accept-Encoding
x-dropbox-response-origin: far_remote
x-dropbox-request-id: REDACTED

 

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Thanks for the report. I've asked the team to fix that up.

     

    By the way, note that Dropbox does not officially support accessing 'dl.dropboxusercontent.com' directly like that. You should use 'www.dropbox.com' with the 'dl' or 'raw' parameter and follow redirects, as shown in this help center article.