add: aplication/pdf

This commit is contained in:
Talyx
2022-02-01 21:46:52 +03:00
parent 5afc1e7e83
commit 1df90bf074
3 changed files with 74 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ void Response::setData(Request request, ServerConfig *config)
void Response::OpenResponseFile(const char *path)
{
std::stringstream ss;
// char buf[BUFFSIZE + 1] = {0};
std::ifstream file(path, std::ifstream::in);
if (file.is_open())
@@ -88,7 +89,9 @@ std::string Response::getContentType(void)
else if (type == "png")
return ("image/png");
else if (type == "bmp")
return ( "image/bmp");
return ("image/bmp");
else if (type == "pdf")
return ("application/pdf");
else
return ("text/plain");