Repository: thecoshman/http (language: rust)

Issue:
Update my email
Noticed that my @gmail is being used here, so I'll be looking to update that at some point.

I'll have to workout what email I actually to use, it's a big deal like.


Discussion / hints:

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index 67759b6..725f401 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,10 +9,11 @@ categories = ["network-programming", "web-programming::http-server"]
 license = "MIT"
 build = "build.rs"
 # Remember to also update in appveyor.yml
-version = "1.4.0"
+version = "1.4.1"
 # Remember to also update in http.md
-authors = ["thecoshman <thecoshman@gmail.com>",
-           "nabijaczleweli <nabijaczleweli@gmail.com>"]
+authors = ["thecoshman <rust@thecoshman.com>",
+           "nabijaczleweli <nabijaczleweli@gmail.com>",
+           "pheki"]
 
 [dependencies]
 hyper-native-tls = "0.2"
diff --git a/appveyor.yml b/appveyor.yml
index 7709ccf..742e0cf 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,4 +1,4 @@
-version: 1.4.0-{build}
+version: 1.4.1-{build}
 
 skip_tags: false
 
@@ -22,21 +22,21 @@ build: off
 build_script:
   - git submodule update --init --recursive
   - cargo build --verbose --release
-  - cp target\release\http.exe http-v1.4.0.exe
-  - strip --strip-all --remove-section=.comment --remove-section=.note http-v1.4.0.exe
-  - makensis -DHTTP_VERSION=v1.4.0 "/X!include \"EnvVarUpdate.nsh\"" install.nsi
+  - cp target\release\http.exe http-v1.4.1.exe
+  - strip --strip-all --remove-section=.comment --remove-section=.note http-v1.4.1.exe
+  - makensis -DHTTP_VERSION=v1.4.1 "/X!include \"EnvVarUpdate.nsh\"" install.nsi
 
 test: off
 test_script:
   - cargo test --verbose --release
 
 artifacts:
-  - path: http-v1.4.0.exe
-  - path: http v1.4.0 installer.exe
+  - path: http-v1.4.1.exe
+  - path: http v1.4.1 installer.exe
 
 deploy:
   provider: GitHub
-  artifact: /http.*v1.4.0.*\.exe/
+  artifact: /http.*v1.4.1.*\.exe/
   auth_token:
     secure: ZTXvCrv9y01s7Hd60w8W7NaouPnPoaw9YJt9WhWQ2Pep8HLvCikt9Exjkz8SGP9P
   on:
diff --git a/http.md b/http.md
index 27fac0b..ea3c0e8 100644
--- a/http.md
+++ b/http.md
@@ -197,8 +197,9 @@ pass parameters like what port to use.
 
 ## AUTHOR
 
-Written by thecoshman &lt;<thecoshman@gmail.com>&gt;,
-       and nabijaczleweli &lt;<nabijaczleweli@gmail.com>&gt;.
+Written by thecoshman &lt;<rust@thecoshman.com>&gt;,
+           nabijaczleweli &lt;<nabijaczleweli@gmail.com>&gt;,
+       and pheki.
 
 ## REPORTING BUGS
 
diff --git a/src/ops.rs b/src/ops.rs
index 3e96e7f..62083b2 100644
--- a/src/ops.rs
+++ b/src/ops.rs
@@ -141,25 +141,33 @@ impl HttpHandler {
 
     fn handle_get(&self, req: &mut Request) -> IronResult<Response> {
         let (req_p, symlink, url_err) = self.parse_requested_path(req);
-        let file = is_actually_file(&req_p.metadata().expect("Failed to get file metadata").file_type());
-        let range = req.headers.get().map(|r: &headers::Range| (*r).clone());
-        let raw_fs = req.headers.get().map(|r: &RawFsApiHeader| r.0).unwrap_or(false);
 
         if url_err {
-            self.handle_invalid_url(req, "<p>Percent-encoding decoded to invalid UTF-8.</p>")
-        } else if !req_p.exists() || (symlink && !self.follow_symlinks) ||
-                  (symlink && self.follow_symlinks && self.sandbox_symlinks && !is_descendant_of(&req_p, &self.hosted_directory.1)) {
-            self.handle_nonexistant(req, req_p)
-        } else if file && raw_fs {
-            self.handle_get_raw_fs_file(req, req_p)
-        } else if file && range.is_some() {
-            self.handle_get_file_range(req, req_p, range.unwrap())
-        } else if file {
-            self.handle_get_file(req, req_p)
-        } else if raw_fs {
-            self.handle_get_raw_fs_dir(req, req_p)
+            return self.handle_invalid_url(req, "<p>Percent-encoding decoded to invalid UTF-8.</p>");
+        }
+
+        if !req_p.exists() || (symlink && !self.follow_symlinks) ||
+           (symlink && self.follow_symlinks && self.sandbox_symlinks && !is_descendant_of(&req_p, &self.hosted_directory.1)) {
+            return self.handle_nonexistant(req, req_p);
+        }
+
+        let is_file = is_actually_file(&req_p.metadata().expect("Failed to get file metadata").file_type());
+        let range = req.headers.get().map(|r: &headers::Range| (*r).clone());
+        let raw_fs = req.headers.get().map(|r: &RawFsApiHeader| r.0).unwrap_or(false);
+        if is_file {
+            if raw_fs {
+                self.handle_get_raw_fs_file(req, req_p)
+            } else if range.is_some() {
+                self.handle_get_file_range(req, req_p, range.unwrap())
+            } else {
+                self.handle_get_file(req, req_p)
+            }
         } else {
-            self.handle_get_dir(req, req_p)
+            if raw_fs {
+                self.handle_get_raw_fs_dir(req, req_p)
+            } else {
+                self.handle_get_dir(req, req_p)
+            }
         }
     }
 


Test patch: