-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev/location test pr #10
Conversation
check the logic for updating and modifying paths, Location to check the full path, fix circular build error -- Server.cpp
… in ckass: HttpResponse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @miooo0o ,
thanks for you hard work.
I see some parts that need modification.
Please have look at my review and change those points.
Leave comment or message after your modification.
Thanks!
std::string _extractPathFromUri(const std::string& uri); | ||
std::string _getMatchedLocation(std::string path, | ||
const std::map<std::string, | ||
Location*>& locations); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
24, 25 줄에 있는 함수들은 왜 클래스 밖에 따로 선언하셨나요? 특별한 이유가 있을까요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
함수 위치가 확정이 안되서요. 따로 변경사항 없으면 나중에 member로 넣을거에요.
/// @brief Generates an HTML page with a directory listing. | ||
/// @param path | ||
/// @return Create a list of directories and files in HTML and export it to std::stringstream. | ||
std::string genDirListingHtml(const std::string& path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 함수는 클래스에서 따로 빼신거 잘 하신거 같아요. 어차피 나중에 디렉토리에 직접 탐색해서 있는 파일들 이름으로 하이퍼링크를 달면 될 거 같아서, 클래스에서 따로 빼서 쓰는 것도 좋은 선택인거 같네요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 그것도 좋은 생각입니다! 사실 이 함수도 일단은 member로 넣을 이유가 크게 없어서 빼둔건데 계속 유지하는거로 생각할게요!
src/server/StaticFileHandler.cpp
Outdated
{ | ||
// if (/* && location.location.isListDir() */) | ||
// return (_handleDirListing(request, location)); | ||
return (_handleDirRequest(request, location)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거는 보정이 필요해 보입니다. 탭이 너무 많네요... ㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인하고 수정할게요!
|
||
std::cout << "TEST | absolute path that with index is built: " << _handledPath << std::endl; | ||
if (isFile(_handledPath)) | ||
return (_handleNotFound()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 91: The condition is wrong.
- I think you wanted to do like this:
if (!isFile(_handledPath))
return (_handleNotFound());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이런 치명적인 실수를. 감사합니다, 수정할게요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your correction.
Implemented the import of Config and Location classes and the creation of the correct response.
ext
inmime-type
list so that it does not contain.
tested: