adding the Access-Control-Allow-Origin header to files served from filesystem in dioxus-desktop (#2818)

This commit is contained in:
Sylvain Tertois 2024-08-12 12:52:51 -07:00 committed by GitHub
parent f10ba975ba
commit a2180b92e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -201,6 +201,7 @@ fn serve_from_fs(path: PathBuf) -> Result<Response<Vec<u8>>> {
Ok(Response::builder()
.header("Content-Type", get_mime_from_path(&asset)?)
.header("Access-Control-Allow-Origin", "*")
.body(std::fs::read(asset)?)?)
}