Hi! We use Vercel Blob to store some assets that our users can download. This is one of them. We want to make sure we can switch the storage implementation if needed, so we don’t share these long blob-specific URLs. Instead we use our custom domain that rewrites to that long URL behind the scenes. So this is the same resource, just behind our domain.
But there’s an issue where the headers returned for the nice, short URL don’t include the content type:
curl --head https://assets.cesko.digital/935ccf9f.pdfHTTP/2 200 access-control-allow-origin: *cache-control: public, max-age=31536000, s-maxage=300cf-cache-status: MISScf-ray: 8f35df5b5cc5d27c-FRAcontent-disposition: inline; filename="935ccf9f.pdf"content-security-policy: default-src 'none'; media-src 'self'; style-src 'unsafe-inline'; img-src 'self'date: Tue, 17 Dec 2024 09:26:36 GMTetag: W/"e037c22126b399f728950e26343318cf"last-modified: Wed, 20 Nov 2024 11:51:38 GMTserver: Vercelstrict-transport-security: max-age=63072000vary: Accept-Encodingx-content-type-options: nosniffx-vercel-id: fra1::s7fxp-1734427596027-6a3b25262544x-vercel-origin: blobWhereas the longer blob-specific response does include the content type:
curl --head https://Bbp30zNE50Ll9cz3.public.blob.vercel-storage.com/935ccf9f.pdfHTTP/2 200 date: Tue, 17 Dec 2024 09:27:50 GMTcontent-type: application/pdfaccess-control-allow-origin: *cache-control: public, max-age=31536000, s-maxage=300content-disposition: inline; filename="935ccf9f.pdf"content-security-policy: default-src 'none'; media-src 'self'; style-src 'unsafe-inline'; img-src 'self'etag: W/"e037c22126b399f728950e26343318cf"last-modified: Wed, 20 Nov 2024 11:51:38 GMTvary: Accept-Encodingx-content-type-options: nosniffx-vercel-origin: blobcf-cache-status: MISSserver: cloudflarecf-ray: 8f35e12649f8f976-PRGThis makes the URL break in some browsers that don’t realize this is a PDF file. Is it possible to make this work?
PS. I have temporarily switched from rewrite to a redirect on the assets.cesko.digital domain to work around the issue in prod. Still would love to have it work with a rewrite instead.