Open
Conversation
- SPA redirect to index.html when extensions are turned on - Protection from accessing files outside root by default. - Return rather than panic when failing to bind to socket.
richard-uk1
commented
Mar 6, 2021
| // Serve the requested file. | ||
| let resp = serve_file(&req, &config.root_dir).await; | ||
| // Here we pass a `&PathBuf` to a function expecting a `&Path`. This works because of *deref | ||
| // coercions*, in this case meaning that `PathBuf` implements `Deref` with `Target=Path`. |
Contributor
Author
There was a problem hiding this comment.
This comment is out of date. Needs removing.
|
|
||
| impl std::str::FromStr for Auth { | ||
| type Err = &'static str; | ||
| fn from_str(s: &str) -> std::result::Result<Self, Self::Err> { |
Contributor
Author
There was a problem hiding this comment.
I've made this parser very lenient, to the point that it cannot fail! I think it's still a good idea to leave it in FromStr, so it could be made less lenient in the future by only altering code here.
|
Patiently awaiting these improvements 👍 |
Contributor
Author
|
Pingy ping 🙂 |
Contributor
Author
|
Hi @brson hope you don't mind another ping. I promise it's an easy to review PR. :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've bundled up all my previous PRs into a single PR and added basic auth. I needed all this stuff for some use of my own, but hope that the work is useful to others. This PR includes
Closes #23
Closes #22
Closes #19