Feature #615

mod_ssi has a hardcoded MIME type.

Added by Anonymous over 8 years ago. Updated over 4 years ago.

Status:FixedStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:mod_ssi
Target version:1.4.23
Missing in 1.5.x:No

Description

mimetype.assign = (
    ".xhtml" => "application/xhtml+xml",
    ".sxhtml" => "application/xhtml+xml")

$HTTP[[useragent]] =~ "MSIE" {
    mimetype.assign = (
        ".xhtml" => "text/html",
        ".sxhtml" => "text/html")
}

ssi.extension = (".shtm", ".shtml", ".sxhtml")

.XHTML is sent as application/xhtml+xml
.SXHTML is sent as text/html

-- SpookyET

Associated revisions

Revision 2519
Added by stbuehler over 5 years ago

Add ssi.content-type option (default text/html, fixes #615)

Revision 2520
Added by stbuehler over 5 years ago

Add ssi.content-type option (default text/html, fixes #615)

History

#1 Updated by Anonymous over 7 years ago

Will this be fixed in 1.5? If I use #include SSI directives I do not need to use PHP at all on my site, but not being able to send out the correct MIME type prevents me from doing this (in my case, I cannot use inline SVG without sending out an application/xhtml+xml MIME type).

-- evan

#2 Updated by Anonymous over 7 years ago

I just peeked at the code for mod_ssi.c and saw a line like this:


response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/html"))

Since it looked like lighttpd was just overwriting whatever header was previously there, I commented out the line and recompiled. Sure enough, lighttpd serves the correct MIME type for my pages now. I'm obviously not familiar with the lighttpd codebase, but it could be the case that this line was just thrown in during the initial coding of mod_ssi to get things working, and can now be safely removed.

I did the modification with 1.4.13, but the code for 1.5.0-r1691 (the latest release on the download page) is exactly the same.

-- evan

#3 Updated by stbuehler about 6 years ago

  • Target version changed from 1.4.20 to 1.4.21

#4 Updated by icy over 5 years ago

  • Target version changed from 1.4.21 to 1.4.22
  • Patch available set to No

#5 Updated by jannewmarch over 5 years ago

I have an XML file (content-type type application/xml) with server-side includes. It gets its content-type set to text/html which stuffs up the XSLT stylesheets since the browser gets the wrong type. I tried removing the offending line in mod_ssi.c that sets the content-type and now it is fine. Is there some issue with removing that line from the production source, since it has been suggested several times and nothing has happened?

Cheers,

Jan

#6 Updated by stbuehler over 5 years ago

  • Target version changed from 1.4.22 to 1.4.23

#7 Updated by stbuehler over 5 years ago

  • Assignee deleted (jan)
  • Priority changed from High to Normal

Not setting the content-type is a bad idea.

#8 Updated by stbuehler over 5 years ago

  • Tracker changed from Bug to Feature

#9 Updated by stbuehler over 5 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2519.

#10 Updated by stbuehler over 4 years ago

  • Missing in 1.5.x set to No

Also available in: Atom