From 356e119d9b5724dd91d5ac3f4382d7b0e71c203e Mon Sep 17 00:00:00 2001 From: Lerry Date: Fri, 9 Jul 2021 10:10:33 +0800 Subject: [PATCH 1/4] Update httpserver.py --- httpserver.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/httpserver.py b/httpserver.py index 660d559..db9d1e0 100755 --- a/httpserver.py +++ b/httpserver.py @@ -204,7 +204,7 @@ def translate_path(self, path): path = posixpath.normpath(urllib.unquote(path)) words = path.split('/') words = filter(None, words) - path = root_path#os.getcwd() + path = root_path for word in words: drive, word = os.path.splitdrive(word) head, word = os.path.split(word) @@ -217,11 +217,8 @@ def _test(self): headers = str(self.headers).split() print 'Range' in self.headers for index,data in enumerate(headers): - #print data if data.strip().lower().startswith('range'):#.startswith('range:'): - #print data, headers[index+1] pass - #print str(headers) return _RerootedHTTPRequestHandler class ThreadingServer(ThreadingMixIn, HTTPServer): From 98aa2c681915c1ab00d993c3f046d96578095eae Mon Sep 17 00:00:00 2001 From: Lerry Date: Fri, 9 Jul 2021 10:10:59 +0800 Subject: [PATCH 2/4] Update README --- README | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README b/README index 53dda2b..602e172 100644 --- a/README +++ b/README @@ -1,6 +1,9 @@ httpserver ======================================= This httpserver is a enhanced version of SimpleHTTPServer. + It was write in python, I use some code from bottle[https://github.com/defnull/bottle] + It support resuming download, you can set the document root, it has more + friendly error hit, and it can handle mimetype gracefully From 2374fe3521498875fc078db735ddb26215650760 Mon Sep 17 00:00:00 2001 From: Lerry Date: Fri, 9 Jul 2021 10:12:16 +0800 Subject: [PATCH 3/4] Create LINSENCE --- LINSENCE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LINSENCE diff --git a/LINSENCE b/LINSENCE new file mode 100644 index 0000000..35740e3 --- /dev/null +++ b/LINSENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016-present Sanic Community + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From b03a049b0bd14f55a250fc29f31e891b6d54532d Mon Sep 17 00:00:00 2001 From: Lerry Date: Fri, 9 Jul 2021 10:12:43 +0800 Subject: [PATCH 4/4] Rename LINSENCE to LICENSE --- LINSENCE => LICENSE | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LINSENCE => LICENSE (100%) diff --git a/LINSENCE b/LICENSE similarity index 100% rename from LINSENCE rename to LICENSE