HTTPS "GET/POST" request becomes "ET/POST"

Topics: blog, faq
Sep 11, 2013 at 10:41 AM
hallo,

the Problem has been mentioned here already.
Is there any solution for the Issue?

thanks.
Marek
Developer
Sep 12, 2013 at 10:23 AM
Not sure whats going wrong there. Using a secure listener, the HttpContext's OnReceive method get fired twice for one request. The first time with buffer of length 1, containing the missing 'G', and the second time with the buffer filled with the rest of the HTTP request.

Maybe jgauffin has a real solution, but a quick fix would be to manually correct the value. Open HttpServer/Messages/Parser/HttpParser.cs and go to the OnFirstLine method. Change
else
{
    try
    {
        _requestEventArgs.Method = words[0].ToUpper();
    }
    catch (ArgumentException err)
    {
        throw new BadRequestException("Unrecognized HTTP method: " + words[0], err);
    }

    _requestEventArgs.UriPath = words[1];
    _requestEventArgs.Version = words[2];
    RequestLineParsed(this, _requestEventArgs);
}
to
else
{
    try
    {
        string method = words[0].ToUpper();

        if (method == "ET")
        {
            method = "GET";
        }

        _requestEventArgs.Method = method;
    }
    catch (ArgumentException err)
    {
        throw new BadRequestException("Unrecognized HTTP method: " + words[0], err);
    }

    _requestEventArgs.UriPath = words[1];
    _requestEventArgs.Version = words[2];
    RequestLineParsed(this, _requestEventArgs);
}