diff options
Diffstat (limited to 'license-generator/src')
| -rw-r--r-- | license-generator/src/bin/license.rs | 2 | ||||
| -rw-r--r-- | license-generator/src/response.rs | 8 | 
2 files changed, 10 insertions, 0 deletions
| diff --git a/license-generator/src/bin/license.rs b/license-generator/src/bin/license.rs index 3abac9d..859ddfa 100644 --- a/license-generator/src/bin/license.rs +++ b/license-generator/src/bin/license.rs @@ -172,6 +172,8 @@ Content-Disposition: attachment; filename=\"dome-key-license.zip\"\n\n")                                  .and_then(|_|                                      req.stdout().write_all(&zip_data.into_inner())                                  ).unwrap_or(()); +                        } else { +                            return response::error_404(&mut req.stdout());                          }                      } else {                          error!( diff --git a/license-generator/src/response.rs b/license-generator/src/response.rs index b858a79..4e838bc 100644 --- a/license-generator/src/response.rs +++ b/license-generator/src/response.rs @@ -42,6 +42,14 @@ pub fn error_403<W: Write>(w: &mut W, message: Option<&str>) {      ).unwrap_or(());  } +pub fn error_404<W: Write>(w: &mut W) { +    write!(w, "Status: 404 +Content-Type: text/plain + +404 Not Found") +        .unwrap_or(()); +} +  pub fn error_405<W: Write>(w: &mut W, allowed_methods: &str) {      set_405(w, allowed_methods).unwrap_or(());      write!(w, "Content-Type: text/plain | 
