From 5af5bb3e959ae7e035385ca4f3e1b629a15b9ea5 Mon Sep 17 00:00:00 2001 From: Paul Z Date: Fri, 20 Oct 2023 15:11:44 +0200 Subject: [PATCH] CreatedBy Header --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7ac3f52..c50653c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ use axum::{ body::{HttpBody, StreamBody}, debug_handler, extract::{BodyStream, FromRef, FromRequest, Multipart, Path, Query, State}, - headers::ContentType, + headers::{ContentType, Range}, http::{ header::{self, CONTENT_TYPE}, HeaderMap, Request, StatusCode, @@ -355,6 +355,9 @@ async fn get_item( header::CONTENT_LENGTH, metadata.size.unwrap_or_default().into(), ); + if let Ok(subject) = metadata.subject.parse() { + headers.insert("CreatedBy", subject); + } if let Some(content_type) = metadata.content_type.and_then(|x| x.parse().ok()) { headers.insert(header::CONTENT_TYPE, content_type);