Header parsing failing on underscore

Apr 10, 2009 at 12:11 AM
Edited Apr 10, 2009 at 12:12 AM
In HttpRequestParser.cs:274
-------------
    else if (!char.IsLetterOrDigit(ch) && ch != '-')
    {
        _log.Write(this, LogPrio.Warning, "Invalid character in header name on line " + currentLine);
        throw new BadRequestException("Invalid character in header name on line " + currentLine);
    }
-------------

Example HTTP header value that would fail:
SM_USER: chris

IIS/ASP.NET doesn't have any issues handling this header.
Some other web servers would translate this into SM-USER and don't handle it at all.

Any reason against updating the invalid character statement to include a   && ch != '_'   check as well?