mirror of https://github.com/adamdruppe/arsd.git
better standard compliance on missing content-type (matters for ie on my win8 box)
This commit is contained in:
parent
bf191b2242
commit
a7823e8e6a
7
cgi.d
7
cgi.d
|
@ -812,14 +812,17 @@ class Cgi {
|
|||
}
|
||||
}
|
||||
|
||||
if(pps.contentType == "application/x-www-form-urlencoded") {
|
||||
// while a content type SHOULD be sent according to the RFC, it is
|
||||
// not required. We're told we SHOULD guess by looking at the content
|
||||
// but it seems to me that this only happens when it is urlencoded.
|
||||
if(pps.contentType == "application/x-www-form-urlencoded" || pps.contentType == "") {
|
||||
pps.isMultipart = false;
|
||||
} else if(pps.contentType == "multipart/form-data") {
|
||||
pps.isMultipart = true;
|
||||
enforce(pps.boundary.length, "no boundary");
|
||||
} else {
|
||||
// FIXME: should set a http error code too
|
||||
throw new Exception("unknown request content type");
|
||||
throw new Exception("unknown request content type: " ~ pps.contentType);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue