pyservx 1.0.0__py3-none-any.whl → 1.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyservx/__init__.py +1 -1
- pyservx/server.py +4 -4
- {pyservx-1.0.0.dist-info → pyservx-1.0.1.dist-info}/METADATA +1 -1
- pyservx-1.0.1.dist-info/RECORD +7 -0
- pyservx-1.0.0.dist-info/RECORD +0 -7
- {pyservx-1.0.0.dist-info → pyservx-1.0.1.dist-info}/WHEEL +0 -0
- {pyservx-1.0.0.dist-info → pyservx-1.0.1.dist-info}/entry_points.txt +0 -0
- {pyservx-1.0.0.dist-info → pyservx-1.0.1.dist-info}/licenses/LICENSE +0 -0
pyservx/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.0.0
|
|
1
|
+
__version__ = "1.0.1" # Changed from 1.0.0
|
pyservx/server.py
CHANGED
|
@@ -90,10 +90,10 @@ class FileRequestHandler(http.server.SimpleHTTPRequestHandler):
|
|
|
90
90
|
# Prevent path traversal attacks
|
|
91
91
|
path = posixpath.normpath(urllib.parse.unquote(path))
|
|
92
92
|
rel_path = path.lstrip('/')
|
|
93
|
-
abs_path = os.path.abspath(os.path.join(self.
|
|
94
|
-
if not abs_path.startswith(self.
|
|
93
|
+
abs_path = os.path.abspath(os.path.join(self.base_dir, rel_path))
|
|
94
|
+
if not abs_path.startswith(self.base_dir):
|
|
95
95
|
logging.warning(f"Path traversal attempt detected: {path}")
|
|
96
|
-
return self.
|
|
96
|
+
return self.base_dir # Prevent access outside the base directory
|
|
97
97
|
return abs_path
|
|
98
98
|
|
|
99
99
|
def do_GET(self):
|
|
@@ -585,7 +585,7 @@ def run(base_dir):
|
|
|
585
585
|
# Set up the server with the base directory
|
|
586
586
|
class Handler(FileRequestHandler):
|
|
587
587
|
def __init__(self, *args, **kwargs):
|
|
588
|
-
self.
|
|
588
|
+
self.base_dir = base_dir
|
|
589
589
|
super().__init__(*args, **kwargs)
|
|
590
590
|
|
|
591
591
|
# Print IP addresses before starting the server
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pyservx/__init__.py,sha256=P46sCZCW1SAUson0VT-PllU42gLB5p1DFWEt12Kdn38,43
|
|
2
|
+
pyservx/server.py,sha256=cyowYkXVR3PhffeNVO5YKb4UYYmDwAIEmRhOwN5ENtA,21882
|
|
3
|
+
pyservx-1.0.1.dist-info/METADATA,sha256=1p3PW36RHHyRFLdkE1DGo10SHqW68KIN4Irsh6BacMY,1382
|
|
4
|
+
pyservx-1.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
5
|
+
pyservx-1.0.1.dist-info/entry_points.txt,sha256=tRdMhIAJUa2bpIJ5h9ZkKPdSSp8fnYlPDGcJhdh01TY,48
|
|
6
|
+
pyservx-1.0.1.dist-info/licenses/LICENSE,sha256=RQfbbgFORXVcSaR2_p6XSOR7k0yw1iGfpnW7mg1NW9c,1074
|
|
7
|
+
pyservx-1.0.1.dist-info/RECORD,,
|
pyservx-1.0.0.dist-info/RECORD
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
pyservx/__init__.py,sha256=Aj77VL1d5Mdku7sgCgKQmPuYavPpAHuZuJcy6bygQZE,21
|
|
2
|
-
pyservx/server.py,sha256=4SnNXHazlkRfXybqbwT7RZzXhBkd8d7ZY_FOlmJlPRw,21910
|
|
3
|
-
pyservx-1.0.0.dist-info/METADATA,sha256=Kk2bXyOOtftvrYVrA6Yoadr0Xgeon9wJG5ez0-O5h-8,1382
|
|
4
|
-
pyservx-1.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
5
|
-
pyservx-1.0.0.dist-info/entry_points.txt,sha256=tRdMhIAJUa2bpIJ5h9ZkKPdSSp8fnYlPDGcJhdh01TY,48
|
|
6
|
-
pyservx-1.0.0.dist-info/licenses/LICENSE,sha256=RQfbbgFORXVcSaR2_p6XSOR7k0yw1iGfpnW7mg1NW9c,1074
|
|
7
|
-
pyservx-1.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|