are sensitive to the filesystem are rejected, i.e. forward slashes,
backward slashes, and sequences of more than one dot. This supports iDNS
without compromising the safety of mass vhosting.
PR: 6635
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87803
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0b1
+ *) Relax the syntax checking of Host: headers in order to support
+ iDNS. PR#6635 [Tony Finch]
+
*) Cleanup the byterange filter to use the apr_brigade_partition
and apr_bucket_copy functions. This removes a lot of very messy
code, and hopefully makes this filter more stable.
* already; otherwise, further validation is needed
*/
if (r->hostname[0] != '[') {
- dst = host;
- while (*dst) {
- if (!apr_isalnum(*dst) && *dst != '-') {
- if (*dst == '.') {
- dst++;
- if (*dst == '.')
- goto bad;
- else
- continue;
- }
- goto bad;
- }
- else {
- dst++;
- }
+ for (dst = host; *dst; dst++) {
+ if (*dst == '.') {
+ dst++;
+ if (*dst == '.')
+ goto bad;
+ }
+ else if (*dst == '/' || *dst == '\\') {
+ goto bad;
+ }
}
/* strip trailing gubbins */
if (dst > host && dst[-1] == '.') {