Skip to content

Commit 4c2f450

Browse files
committed
fixed CORS for web
1 parent 83bd5cd commit 4c2f450

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/fula-cli/src/routes.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,17 @@ async fn object_post_handler(
261261
/// If origins contains "*", allows any origin (development mode)
262262
/// Otherwise, only allows specified origins
263263
fn create_cors_layer(origins: &[String]) -> CorsLayer {
264-
// Standard S3-compatible headers we need to expose
264+
// Standard S3-compatible headers + Fula encryption headers we need to expose
265+
// Note: These headers are ALREADY sent by the server. This just allows browsers to read them.
265266
let expose_headers = vec![
266267
header::ETAG,
267268
header::CONTENT_LENGTH,
268269
header::CONTENT_TYPE,
269270
header::LAST_MODIFIED,
271+
// Fula encryption headers (already sent, just need CORS visibility for WASM)
272+
header::HeaderName::from_static("x-amz-meta-x-fula-encrypted"),
273+
header::HeaderName::from_static("x-amz-meta-x-fula-encryption"),
274+
header::HeaderName::from_static("x-amz-meta-x-fula-chunked"),
270275
];
271276

272277
// S3-compatible methods

0 commit comments

Comments
 (0)