rejetto / hfs

HFS is a web file server to run on your computer. Share folders or even a single file thanks to the virtual file system.
GNU General Public License v3.0
2.29k stars 227 forks source link

MIME not work with upper case extension #375

Closed dateno1 closed 1 year ago

dateno1 commented 1 year ago

BEFORE

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'

Describe the bug

  1. File extension is lower case work well
  2. If i rename file to upper case&mime is not work (just downloaded)

Expected behavior MIME is not work with Upper case filename

Screenshots Mime It test with IRC Lounge client

1st time i try it with lower case extension 2st time i was rename file to upper case extension&retry

If i copy&paste URL to firefox's address bar lower case show image but upper case is file downloaded

Environment (please complete the following information):

Additional context Current Config

version: 0.48.2
accounts:
allowed_referer: "*.example.com"
open_browser_at_start: false
log_gui: true
dont_log_net: 127.0.0.1|::1|192.168.0.0/16|10.0.0.0/8
proxies: 1
force_lang: en
enable_plugins:
  - antibrute
  - antidos
  - max-downloads-ip
  - mini-player
  - video-player
  - show-any
plugins_config:
  max-downloads-ip:
    limit: 10
  show-any:
    extensions:
      - ext: txt
      - ext: pdf
      - ext: flac
      - ext: mp3
      - ext: png
      - ext: jpg
      - ext: jpeg
      - ext: m4a
      - ext: ogg
      - ext: wav
      - ext: mp4
      - ext: mov
      - ext: wmv
      - ext: mkv
      - ext: webp
  antidos:
    max: 2000
admin_net: 127.0.0.1|::1|192.168.0.0/16|10.0.0.0/8
localhost_admin: false
vfs:
                                -----------------Deleted before upload----------------
  source: root
base_url: https://hfs.example.com
favicon: Favicon.ico
mime:
  "*.aac": audio/mp4
  "*.ape": audio/monkey
  "*.flac": audio/FreeLossless
  "*.m4a": audio/mp4
  "*.mid|*.midi": audio/midi
  "*.mp2|*.mp3": audio/mpeg
  "*.ogg|*.oga": audio/ogg
  "*.wav": audio/wav
  "*.weba": audio/webm
  "*.wma": audio/x-ms-wma
  "*.avi": video/x-msvideo
  "*.flv": video/x-flv
  "*.mp4": video/mp4
  "*.mkv": video/x-matroska
  "*.mpg|*.mpeg": video/mpeg
  "*.ogv": video/ogg
  "*.webm": video/webm
  "*.wmv": video/x-ms-wmv
  "*.gif": image/gif
  "*.ico": image/x-icon
  "*.jpg|*.jpeg": image/jpeg
  "*.png": image/png
  "*.svg": image/svg+xml
  "*.tif|*.tiff": image/tiff
  "*.webp": image/webp
  "*.css": text/css
  "*.csv": text/csv
  "*.js": text/javascript
  "*.txt": text/plain
  "*.pdf": application/pdf
  "*": Auto
zip_calculate_size_for_seconds: 100

Thanks for fix login button

Now it work well with enter key&screen button

rejetto commented 1 year ago

thanks for reporting! the fix is ready, i will see to publish soon and report here.

but let me tell you: you have the problem because somehow you changed "auto" to "Auto", and the system is not recognizing it that way. You can solve your problem right now, without any new version, by deleting all of your mime configurations, and leaving only "*": auto, with lowercase.

The auto supports, i think, all of the extensions you configured manually. You had to enter them only because it was not working because of the capital "A" in auto.

dateno1 commented 1 year ago

Thanks for help

change 'Auto' -> 'auto' All work well :D

Also MIME on firefox is fixed (chrome work with 'auto' and 'Auto' + no mime setting)

That is my misstake

but I think change hfs to work with 'auto'&'Auto'&'AUTO' is better (someone can do same misstake)

rejetto commented 1 year ago

but I think change hfs to work with 'auto'&'Auto'&'AUTO' is better (someone can do same misstake)

yes