-
Notifications
You must be signed in to change notification settings - Fork 84
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
"GET /img/menu_logo.76408655.png HTTP/1.1" 404 #177
Comments
How to handle it using a single routing handler, I don't know. In my opinion, the current code is just not very elegant. I don't think it's the absence of the /static prefix in the path. You can see my log in handle_Embedded_FILE. You can't explain why only a few files failed. "GET /img/menu_logo.76408655.png HTTP/1.1" 404 "GET /img/logs.fa1e7ddd.css HTTP/1.1" 200 Take a look at the file in the static directory. Why one can succeed and the other can't. |
@pyrossh There are 4 directories and 38 files in the static folder. There are 8 files in the IMG folder. Why only 7 files in img folder and 2 files in fonts folder will fail while the other 29 files are successful? |
@pyrossh The example route prefix is dist, while my route prefix is JS and CSS and IMG and fonts.So I don't know how to handle it with the single route handle. |
In this case you would use /static instead of /dist and also you would need to prefix the html/webpack to use /static/js instead of just js a simpler approach. Maybe that would be easier to figure out this bug. |
@pyrossh All files were successful in Cargo Build. An error occurs only when cargo Build --release is used. |
I tried to work with HTML/Webpack in the same way as the example. |
Ahh ok it seems to fail in release only. Also it seems .css file in img directory works. Can you try with another css file in that directory as well as in the fonts directory and see if that works. Also do disable your cache while testing maybe that would help in finding out. |
Closing this due to inactivity. |
"GET /img/menu_logo.76408655.png HTTP/1.1" 404
[2022-05-12T10:29:03Z INFO xdls::controller::statics] img-params===Path("menu_logo.76408655.png")
[2022-05-12T10:29:03Z INFO xdls::controller::statics] handle_embedded_file path====img/menu_logo.76408655.png
"GET /fonts/element-icons.535877f5.woff HTTP/1.1" 404
[2022-05-12T10:30:10Z INFO xdls::controller::statics] fonts-params===Path("element-icons.535877f5.woff")
[2022-05-12T10:30:10Z INFO xdls::controller::statics] handle_embedded_file path====fonts/element-icons.535877f5.woff
"GET /css/menu_logo.76408655.png HTTP/1.1" 200
[2022-05-12T10:27:20Z INFO xdls::controller::statics] handle_embedded_file path====css/menu_logo.76408655.png
"GET /img/logs.fa1e7ddd.css HTTP/1.1" 200
[2022-05-12T10:25:39Z INFO xdls::controller::statics] img-params===Path("logs.fa1e7ddd.css")
[2022-05-12T10:25:39Z INFO xdls::controller::statics] handle_embedded_file path====img/logs.fa1e7ddd.css
Currently all files in the Fonts folder will be 404.
Currently all files in the IMG folder except logs.fa1e7ddd.css are 404.
actix-web = "4.0.0"
rust-embed = "6.4.0"
MacBookPro:static qxq$ tree
.
├── css
│ ├── app.2748f048.css
│ ├── chunk-vendors.4ba11380.css
│ ├── chunk-vendors.4ba11380.css.gz
│ ├── config.39fdc8fc.css
│ ├── config
home.7ae7c0ef.csshome.fe5be4d4.js│ ├── home.ad65ad08.css
│ ├── login.6d5cd834.css
│ ├── logs.fa1e7ddd.css
│ ├── menu_logo.76408655.png
│ └── system.9e578feb.css
├── favicon.ico
├── fonts
│ ├── element-icons.535877f5.woff
│ └── element-icons.732389de.ttf
├── img
│ ├── detection1.0aea7e16.jpg
│ ├── detection2.b13e79df.jpg
│ ├── icon_car.b91f3b70.png
│ ├── icon_radar.e1631f11.png
│ ├── img_1.8229e084.png
│ ├── logo.734d0fe1.png
│ ├── logs.fa1e7ddd.css
│ └── menu_logo.76408655.png
├── index.html
└── js
├── app.e012053f.js
├── app.e012053f.js.gz
├── chunk-vendors.17c8ec50.js
├── chunk-vendors.17c8ec50.js.gz
├── config.7094d2aa.js
├── config.7094d2aa.js.gz
├── config
├── config
home.fe5be4d4.js.gzhome├── config
loginlogssystem.5fa4ace5.jshome├── config
loginlogs~system.5fa4ace5.js.gz├── home.17d84104.js
├── home.17d84104.js.gz
├── login.f2d94fbe.js
├── logs.d11034de.js
├── system.98ea62e3.js
└── system.98ea62e3.js.gz
4 directories, 38 files
The text was updated successfully, but these errors were encountered: