PacketFire / paste-click

Paste text, images, video or any file
http://paste.click
3 stars 1 forks source link

No extension on filename #67

Open Tiksi opened 5 years ago

Tiksi commented 5 years ago

Describe the bug When trying to download a file, the content-disposition header is being set the filename lacking the extension. If trying to download arbitrary file types (zip, rar, tar), this can be confusing if you don't know the file type ahead of time.

To Reproduce Steps to reproduce the behavior:

  1. Go to http://cdn.paste.click/fBbjLt7FifSV6cWTXoIDdQ or any other url in a browser
  2. Try to "save as"
  3. Notice the file doesn't have an extension

Expected behavior The file should have the correct extension.

Additional context GCS allows a Content-Disposition header to be set on objects, we should set this with the correct filename with the extension derived from the mimetype determined by mimemagic and passed along to the client in nginx, removing the current content-disposition mapping in nginx as it relies on the old way of storing files locally (with their extension).