Unverified Commit 3aca8d31 authored by Nugine's avatar Nugine
Browse files

s3s: http: ser: application/xml

parent 1f853314
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -87,6 +87,10 @@ impl TryIntoHeaderValue for String {
    }
}

/// See <https://github.com/hyperium/mime/issues/144>
#[allow(clippy::declare_interior_mutable_const)]
const APPLICATION_XML: HeaderValue = HeaderValue::from_static("application/xml");

pub fn set_xml_body<T: xml::Serialize>(res: &mut Response, val: &T) -> S3Result {
    let mut buf = Vec::with_capacity(256);
    {
@@ -96,8 +100,7 @@ pub fn set_xml_body<T: xml::Serialize>(res: &mut Response, val: &T) -> S3Result
            .map_err(S3Error::internal_error)?;
    }
    *res.body_mut() = Body::from(buf);
    res.headers_mut()
        .insert(hyper::header::CONTENT_TYPE, HeaderValue::from_static(mime::TEXT_XML.as_ref()));
    res.headers_mut().insert(hyper::header::CONTENT_TYPE, APPLICATION_XML);
    Ok(())
}

+1 −1
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ if __name__ == "__main__":
    assert counts["aws-sdk-go"]["fail"] == 0
    assert counts["aws-sdk-ruby"]["fail"] == 0
    assert counts["mc"]["fail"] == 0
    assert counts["minio-py"]["fail"] == 0
    assert counts["s3cmd"]["fail"] == 0
    assert counts["s3select"]["fail"] == 0

@@ -73,7 +74,6 @@ if __name__ == "__main__":
    assert counts["minio-dotnet"]["pass"] >= 1
    assert counts["minio-go"]["pass"] >= 1
    assert counts["minio-java"]["pass"] >= 8
    assert counts["minio-py"]["pass"] >= 13
    assert counts["versioning"]["pass"] >= 4

    # assert counts["minio-js"]["pass"] >= 0