We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is more-or-less a follow up to #41. Repeating the same example (on 0.1.2):
#[get("/sample/<path..>")] fn stream(path: PathBuf) -> Option<NamedFile> { let filename = Path::new("/home/dawid/a_directory").join(path.clone()); println!("{:?}, {:?}", filename, path); NamedFile::open(filename).ok() }
This works fine now when stream is mounted at the root and I request http://localhost:8000/sample/dir/file.txt:
stream
http://localhost:8000/sample/dir/file.txt
GET /sample/dir/file.txt: => Matched: GET /sample/<path..> "/home/dawid/a_directory/dir/file.txt", "dir/file.txt"
But, if I mount stream under a segment, per:
… .mount("/abc/", routes![stream])
Then I request http://localhost:8000/abc/sample/dir/file.txt, it is processed as follows:
http://localhost:8000/abc/sample/dir/file.txt
GET /abc/sample/dir/file.txt: => Matched: GET /abc/sample/<path..> "/home/dawid/a_directory/sample/dir/file.txt", "sample/dir/file.txt"
Note the sample segment has crept back in. Additional segments added to the namespace are included in the pathbuf.
sample
The text was updated successfully, but these errors were encountered:
Of course. Confirmed.
Sorry, something went wrong.
a1878ad
Great! Thank you very much. 🙇♀️
Properly resolve dynamic segments, take 2.
0b7aea3
Fixes #86.
No branches or pull requests
This is more-or-less a follow up to #41. Repeating the same example (on 0.1.2):
This works fine now when
stream
is mounted at the root and I requesthttp://localhost:8000/sample/dir/file.txt
:But, if I mount
stream
under a segment, per:Then I request
http://localhost:8000/abc/sample/dir/file.txt
, it is processed as follows:Note the
sample
segment has crept back in. Additional segments added to the namespace are included in the pathbuf.The text was updated successfully, but these errors were encountered: