Skip to content

Commit

Permalink
fix constant
Browse files Browse the repository at this point in the history
  • Loading branch information
nam20485 committed May 2, 2024
1 parent be06051 commit 51dd0cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions OdbDesignServer/Controllers/FileUploadController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace Odb::App::Server
const auto& contentType = req.get_header_value(CONTENT_TYPE_HEADER_NAME);
if (contentType != CONTENT_TYPE_APPLICATION_OCTET_STREAM)
{
return crow::response(crow::status::BAD_REQUEST, "unsupported content type: this endpoint only accepts 'applicaiton/octet-stream'");
return crow::response(crow::status::BAD_REQUEST, std::string("unsupported content type: this endpoint only accepts '") + CONTENT_TYPE_APPLICATION_OCTET_STREAM + "'");
}

return handleOctetStreamUpload(filename, req);
Expand All @@ -50,7 +50,7 @@ namespace Odb::App::Server
if (contentType.find(CONTENT_TYPE_MULTIPART_FORM_DATA) != 0)
{
// "Content-Type" header doesn't start with "multipart/form-data"
return crow::response(crow::status::BAD_REQUEST, "unsupported content type: this endpoint only accepts 'multipart/form-data'");
return crow::response(crow::status::BAD_REQUEST, std::string("unsupported content type: this endpoint only accepts '") + CONTENT_TYPE_MULTIPART_FORM_DATA + "'");
}

return handleMultipartFormUpload(req);
Expand Down
2 changes: 1 addition & 1 deletion OdbDesignServer/Controllers/FileUploadController.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Odb::App::Server
constexpr static const inline char CONTENT_DISPOSITION_HEADER_NAME[] = "Content-Disposition";
constexpr static const inline char CONTENT_TYPE_HEADER_NAME[] = "Content-Type";
constexpr static const inline char CONTENT_TYPE_MULTIPART_FORM_DATA[] = "multipart/form-data";
constexpr static const inline char CONTENT_TYPE_APPLICATION_OCTET_STREAM[] = "multipart/form-data";
constexpr static const inline char CONTENT_TYPE_APPLICATION_OCTET_STREAM[] = "application/octet-stream";


//constexpr static const inline char MULTIPART_FORMDATA_PART_NAME[] = "InputFile"
Expand Down

0 comments on commit 51dd0cc

Please sign in to comment.