forked from loafle/openapi-generator-original
[Rust Server] Improve RFC 13341 compliance for multipart/related (#19355)
* [Rust Server] Improve RFC 13341 compliance for multipart/related * Update samples
This commit is contained in:
parent
be09f8a868
commit
024bbb7784
@ -30,7 +30,10 @@
|
|||||||
{{#-last}}
|
{{#-last}}
|
||||||
|
|
||||||
// Write the body into a vec.
|
// Write the body into a vec.
|
||||||
let mut body: Vec<u8> = vec![];
|
// RFC 13341 Section 7.2.1 suggests that the body should begin with a
|
||||||
|
// CRLF prior to the first boundary. The mime_multipart library doesn't
|
||||||
|
// do this, so we do it instead.
|
||||||
|
let mut body: Vec<u8> = vec![b'\r', b'\n'];
|
||||||
write_multipart(&mut body, &boundary, &body_parts)
|
write_multipart(&mut body, &boundary, &body_parts)
|
||||||
.expect("Failed to write multipart body");
|
.expect("Failed to write multipart body");
|
||||||
{{/-last}}
|
{{/-last}}
|
||||||
|
@ -469,7 +469,10 @@ impl<S, C> Api<C> for Client<S, C> where
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write the body into a vec.
|
// Write the body into a vec.
|
||||||
let mut body: Vec<u8> = vec![];
|
// RFC 13341 Section 7.2.1 suggests that the body should begin with a
|
||||||
|
// CRLF prior to the first boundary. The mime_multipart library doesn't
|
||||||
|
// do this, so we do it instead.
|
||||||
|
let mut body: Vec<u8> = vec![b'\r', b'\n'];
|
||||||
write_multipart(&mut body, &boundary, &body_parts)
|
write_multipart(&mut body, &boundary, &body_parts)
|
||||||
.expect("Failed to write multipart body");
|
.expect("Failed to write multipart body");
|
||||||
|
|
||||||
@ -741,7 +744,10 @@ impl<S, C> Api<C> for Client<S, C> where
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write the body into a vec.
|
// Write the body into a vec.
|
||||||
let mut body: Vec<u8> = vec![];
|
// RFC 13341 Section 7.2.1 suggests that the body should begin with a
|
||||||
|
// CRLF prior to the first boundary. The mime_multipart library doesn't
|
||||||
|
// do this, so we do it instead.
|
||||||
|
let mut body: Vec<u8> = vec![b'\r', b'\n'];
|
||||||
write_multipart(&mut body, &boundary, &body_parts)
|
write_multipart(&mut body, &boundary, &body_parts)
|
||||||
.expect("Failed to write multipart body");
|
.expect("Failed to write multipart body");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user