WIP: feat: x-amz-website-redirect-location support #872

Draft
raitobezarius wants to merge 5 commits from raitobezarius/garage:redirect-meta into main
Showing only changes of commit 647b2dae33 - Show all commits

View file

@ -618,9 +618,11 @@ pub(crate) fn get_headers(headers: &HeaderMap<HeaderValue>) -> Result<HeaderList
} }
} }
// Preserve x-amz-meta- headers // Preserve x-amz-meta- and x-amz-website-redirect-location headers
for (name, value) in headers.iter() { for (name, value) in headers.iter() {
if name.as_str().starts_with("x-amz-meta-") { if name.as_str().starts_with("x-amz-meta-")
|| name.as_str() == "x-amz-website-redirect-location"
{
Review

The value of the header should be validated here to ensure it is syntactically correct, according to S3 rules

The value of the header should be validated here to ensure it is syntactically correct, according to S3 rules
ret.push(( ret.push((
name.to_string(), name.to_string(),
std::str::from_utf8(value.as_bytes())?.to_string(), std::str::from_utf8(value.as_bytes())?.to_string(),