Project

General

Profile

Actions

Bug #2966

closed

No longer possible to easily redefine default mimetype per site?

Added by romanrm over 4 years ago. Updated about 1 month ago.

Status:
Wontfix
Priority:
Low
Category:
-
Target version:
-
ASK QUESTIONS IN Forums:
No

Description

Hello,

In my config file I have:

$HTTP["host"] == "sitename.example.com" {
mimetype.assign += ("" => "text/html")
}

This is because a particular site has a ton of static HTML files without extension (and this is not changeable). This works on 1.4.45. After upgrading to 1.4.53 the above config line fails with:

Duplicate array-key ''

Because there is now /usr/share/lighttpd/create-mime.conf.pl, which contains:

# enable caching for unknown mime types:
"" => "application/octet-stream"

What would be the recommended way to redefine the default mime type now? Or the only way now is to copy create-mime.conf.pl and change it to undo this addition? Any other advice?

Thanks

Actions #1

Updated by gstrauss over 4 years ago

  • Category deleted (core)
  • Priority changed from Normal to Low
  • Target version deleted (1.4.x)

This is a question. Questions belong in the forum. Also, you have not posted your entire config (or a sufficient portion of it). Please post in the forums and provide more details. See the "Forums" tab near the top of the page.

Actions #2

Updated by romanrm over 4 years ago

This is only formulated as a question to try being polite and leave the possibility that I'm missing something here. If you want a bug report, here's your bug report: please undo the thoughtless change in default config which breaks compatibility with real-world set up in use by people. Thanks

Actions #3

Updated by gstrauss over 4 years ago

  • Status changed from New to Wontfix

I politely asked that you post in the forums and provide more information, neither of which you have done yet.

See also #2597 where you asked a similar question 4 years ago.

Actions #4

Updated by gstrauss about 1 month ago

  • ASK QUESTIONS IN Forums set to No

What would be the recommended way to redefine the default mime type now? Or the only way now is to copy create-mime.conf.pl and change it to undo this addition? Any other advice?

One option: mod_magnet magnet.attract-response-start-to with a simple lua script to check response header Content-Type and choose whether or not to redefine the value for the Content-Type header in the response.

Actions

Also available in: Atom