Skip to content

POST request without leads to SEGFAULT #119

@ldsmoreira

Description

@ldsmoreira

In this section of code, when the post request body comes empty the application breaks. Is it the expected behavior ?

else if (request.method == method_t::POST) {
  try {
    if (request.body.empty())
      throw;
    possible_prime = std::stoul(request.body);
  } catch (...) {
    throw std::runtime_error(
        "POST requests should have a path of 'is_prime' and a body with 'SOME_NUMBER'");
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions