-
Notifications
You must be signed in to change notification settings - Fork 199
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
Added basic directory listing fixing #32. Added 301 responses. #35
Conversation
triforce
commented
Nov 3, 2017
•
edited
Loading
edited
- Extended thread buffer by 2048
- Added a very basic HTML formatted response with a list of the directory contents
- When request for a directory is a non forward slash terminated request a 301 is sent to the client, triggering their browser to request a forward slash terminated request.
Added xml, xhtml, gif, png, jpeg, css, and javascript content types. Changed thread memory size to something reasonable. Added simple request logging. Added removal of '../' in URL.
Conflicts: README.md
Formating
For ports <1024.
Just a little Hello World
* Fixed SIGPIPE when transfer is cancelled. * Added a more useful error on bind failure. * Fixed 206 size calculation. * Combined seek & get file size system calls.
Sorry for the delay, I got around to testing it a bit. I ran into a problem when I did something like this: If I go to |
It think's 'a' is a directory for some reason. I will look into it. |
Could you retest please @nemasu? It turned out to be quite a simple fix in the end! |
Hello, sorry for the super late reply. There's 2 potential things though: What do you think? |
Yes sounds fine to me. So presumably when in the web_root there would be no previous directory link shown? Other web servers have directory listing as a config option as well so perhaps we should start planning a way to turn features on and off after this? |
Yeah that makes sense. |
To make thing easier though, I think we should do optional features as a separate issue after merging the directory code. |
Yep makes sense. |
@nemasu feel free to make those changes, I haven't had time recently unfortunately. |
Okay, I'll see if I can. |
This is teetering on the edge of being finished @nemasu. There is just these two issues which you raised outstanding: -Putting the previous directory ("...") at the top of the list. If anyone has some time then feel free to jump in and implement those two issues. |
@nemasu after studying the code more closely it looks like requests to the root directory (and nothing else) adds the default document (index.html), so as part of the outstanding changes still required here we should remove that logic and integrate it with the directory listing functionality. |
Hello @triforce, I've made your changes into a patch file relative to the current HEAD, if you like, you can close this PR and make a new one with the updated patch, and I'll accept it and work on the additions after. Of course, if you want, you can use this PR too, I just don't really know an easy way to do that. |
Merged in PR #58 . |