web: implement x-amz-website-redirect-location

This commit is contained in:
Alex Auvolat
2025-02-19 17:04:10 +01:00
parent f64ec6e542
commit bf27a3ec98
8 changed files with 66 additions and 11 deletions
+4 -1
View File
@@ -1,6 +1,6 @@
use quick_xml::de::from_reader;
use hyper::{Request, Response, StatusCode};
use hyper::{header::HeaderName, Request, Response, StatusCode};
use serde::{Deserialize, Serialize};
use garage_model::bucket_table::*;
@@ -11,6 +11,9 @@ use crate::api_server::{ReqBody, ResBody};
use crate::error::*;
use crate::xml::{to_xml_with_header, xmlns_tag, IntValue, Value};
pub const X_AMZ_WEBSITE_REDIRECT_LOCATION: HeaderName =
HeaderName::from_static("x-amz-website-redirect-location");
pub async fn handle_get_website(ctx: ReqCtx) -> Result<Response<ResBody>, Error> {
let ReqCtx { bucket_params, .. } = ctx;
if let Some(website) = bucket_params.website_config.get() {