add last_modified, etag, cache-control, thread workers, sendfile, follow symlink
use walkdir?
And keep the same problems about static files as the gotham framework (issues/55)
A significant trap that I've seen other frameworks (Rust and non Rust) fall into when dealing with static files is exposing path traversal attack vectors. OWASP has some good documentation on what this is if you've not come across it before. Not getting this right scares the crap out of me so it will need some focus.
Ami44
Actix checks for path traversal atack.
I think Gotham is over complicated framework. I don鈥檛 think we should use it an example
A priori this is not an actix-web problem: js/css files are related to the html file displayed. You should probably fix the css/js path in your index. html file.
@krircc I think your code works right. For /a/h url parh function get call and it always returns index.html file
@fafhrd91 @ami44 yes i think it's right.
I change this:
before
<link rel="stylesheet" href="styles.css">
<script src="main.js"></script>
after
<link rel="stylesheet" href="/styles.css">
<script src="/main.js"></script>
now it is well. I don't think this, this work well use rocket. so now I can start new SPA project use Actix. it's cool.
thanks @fafhrd91 @ami44
Done
Most helpful comment
A priori this is not an actix-web problem: js/css files are related to the html file displayed. You should probably fix the css/js path in your index. html file.