Skip to content

crow::multipart::message hangs on request #320

@Iuliean

Description

@Iuliean

i am sending this request

--d7585ab0-0284-4921-8ed3-dc9c8f6dc4cf
Content-Type: text/plain
Content-Disposition: form-data; name=password

5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8
--d7585ab0-0284-4921-8ed3-dc9c8f6dc4cf--

to it and it just hangs a response is never sent back

my code is the following

void Site::auth(const crow::request& req, crow::response& resp)
{
    CROW_LOG_INFO << "Login Attempt";
    crow::multipart::message msg(req);
    if(msg.parts[0].body == this->password)
    {
        resp.code = 303;
        resp.set_header("location", "/dashboard");
        resp.add_header("set-cookie", Cookie::generateCookie().toString());
        resp.end();
        return;
    }
    else
    {
        resp.code = 401;
        resp.body = "Failed login attempt";
        resp.end();
        return;
    }
}

it works just fine with these requests

------WebKitFormBoundaryBBQ4YQVHhK9X3slD
Content-Disposition: form-data; name="password"

5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8
------WebKitFormBoundaryBBQ4YQVHhK9X3slD--
--f30a8d38-420a-44e4-84b9-a2e136cb068e
Content-Disposition: form-data; name="password"
Content-Length: 64

5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8
--f30a8d38-420a-44e4-84b9-a2e136cb068e--

i tested both crow::multipart::message and msg.parts[0].body and i concluded that it hangs on the crow::multipart::message

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issuean issue suitable to start contributing to the project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions