aboutsummaryrefslogtreecommitdiff
path: root/src/response.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-07-09 01:41:19 +0000
committerFuwn <[email protected]>2022-07-09 01:41:19 +0000
commitd806185bdd41cd89159f5ab729710d84bbae2265 (patch)
tree9d984c80f8f0de526523a320d562f8c3c94748e6 /src/response.rs
parentchore(cargo): republish with --all-features (diff)
downloadwindmark-0.1.19.tar.xz
windmark-0.1.19.zip
feat(response): success with mime responsev0.1.19
Diffstat (limited to 'src/response.rs')
-rw-r--r--src/response.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/response.rs b/src/response.rs
index ed320b5..806eebb 100644
--- a/src/response.rs
+++ b/src/response.rs
@@ -23,6 +23,9 @@ pub enum Response<'a> {
Input(String),
SensitiveInput(String),
Success(String),
+ /// A successful response where the MIME type of the response is manually
+ /// specific by the user
+ SuccessWithMime(String, String),
#[cfg(feature = "auto-deduce-mime")]
/// A successful response where the MIME type of the response is
/// automatically deduced from the provided bytes
@@ -66,6 +69,12 @@ pub(crate) fn to_value_set_status(
value
}
+ Response::SuccessWithMime(value, value_mime) => {
+ *status = 23;
+ *mime = value_mime;
+
+ value
+ }
Response::SuccessFile(value, value_mime) => {
*status = 21; // Internal status code, not real.
*mime = value_mime;