Skip to content

Commit

Permalink
Bugfix: Images can be loaded but I'm not sure how it was fixed...
Browse files Browse the repository at this point in the history
  • Loading branch information
Tentanus committed Apr 28, 2024
1 parent 7e03a0b commit 9c6e59e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/FileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ FileManager::applyLocationSettings(const std::string &request_target,

void FileManager::openGetFile(const std::string &request_target_path)
{
Logger &logger = Logger::getInstance();
const std::string resolved_target =
applyLocationSettings(request_target_path, HTTPMethod::GET);

Expand All @@ -62,15 +61,11 @@ void FileManager::openGetFile(const std::string &request_target_path)
return;
}

logger.log(DEBUG, "REQUESTtarget: " + resolved_target);
if (!std::filesystem::exists(
resolved_target)) // TODO: ERROR: can't print image
if (!std::filesystem::exists(resolved_target))
throw ClientException(StatusCode::NotFound);
logger.log(DEBUG, "file exists");
_request_target.open(resolved_target, std::ios::in | std::ios::binary);
if (!_request_target.is_open())
throw ClientException(StatusCode::NotFound);
logger.log(DEBUG, "file can be found");
HTTPStatus status(StatusCode::OK);
_response += status.getStatusLine("HTTP/1.1");
}
Expand Down

0 comments on commit 9c6e59e

Please sign in to comment.