diff options
| author | Fuwn <[email protected]> | 2022-07-09 01:41:19 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-07-09 01:41:19 +0000 |
| commit | d806185bdd41cd89159f5ab729710d84bbae2265 (patch) | |
| tree | 9d984c80f8f0de526523a320d562f8c3c94748e6 /src/response.rs | |
| parent | chore(cargo): republish with --all-features (diff) | |
| download | windmark-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.rs | 9 |
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; |