RFC 2616 states that method names are case sensitive, but the Squid
parser has been accepting them case-insensitive.
Enforce case-sensitive behaviour when performing strict HTTP parse.
NOTE: avoid HTTP_VIOLATIONS since there is no normative MUST/SHOULD
involved in the specification texts.
}
for (++theMethod; theMethod < Http::METHOD_ENUM_END; ++theMethod) {
+ // RFC 2616 section 5.1.1 - Method names are case-sensitive
+ // NP: this is not a HTTP_VIOLATIONS case since there is no MUST/SHOULD involved.
if (0 == strncasecmp(begin, Http::MethodType_str[theMethod], end-begin)) {
- return;
+
+ // relaxed parser allows mixed-case and corrects them on output
+ if (Config.onoff.relaxed_header_parser)
+ return;
+
+ if (0 == strncmp(begin, Http::MethodType_str[theMethod], end-begin))
+ return;
}
}