MIME type for CGI applications is always returned as text/html. #5
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: threeoh6000/herb#5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In
detect_media_type()
, CGI applications (denoted with a filename ending in.cgi
) are automatically presumed to be text/html for MIME type purposes. This is becauseserve()
wasn't built with the expectation of accommodating CGI applications and as a result usesdetect_media_type()
and the file extension of a file to infer the MIME type of a file even beforeget_page()
is ran to either execute the CGI application or fetch the static file from the filesystem.This is obviously very bad but also presents a compatibility problem with CGI applications that expect to be able to pass the MIME type of its data back to the server as well as CGI applications that pass any non-HTML data back to the server as the server will incorrectly tell the client that it is text/html when it isn't.