Allow gui web to be served through iframes

This commit is contained in:
2026-01-11 10:12:13 +01:00
parent 9b74e6ee85
commit 6c69a9696b
2 changed files with 8 additions and 0 deletions
+2
View File
@@ -1,3 +1,5 @@
target/
**/*.rs.bk
*.sqlite
+6
View File
@@ -7,6 +7,7 @@ use inkopslista_lib::{Item, ItemData};
use rocket::{
fs::{FileServer, NamedFile},
serde::json::Json,
shield::Shield,
State,
};
use sqlite::ConnectionThreadSafe;
@@ -77,6 +78,11 @@ fn rocket() -> _ {
db.execute(include_str!("db/init.sql"))
.expect("unable to initialize database");
rocket::build()
.attach(
Shield::default()
// Allow content to be served through iframes
.disable::<rocket::shield::Frame>(),
)
.manage(db)
.mount("/", routes![index, get_list, put_list, delete_item])
.mount("/", FileServer::from(www_path()))