mirror of
https://github.com/hulthe/inkopslista.git
synced 2026-08-03 23:11:28 +02:00
Allow gui web to be served through iframes
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
target/
|
||||
|
||||
**/*.rs.bk
|
||||
|
||||
*.sqlite
|
||||
|
||||
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user