url fix
This commit is contained in:
@@ -20,14 +20,15 @@ data:
|
||||
}
|
||||
upload-server.py: |
|
||||
#!/usr/bin/env python3
|
||||
import http.server, os, sys, tarfile, io
|
||||
import http.server, os, sys, tarfile, io, urllib.parse
|
||||
|
||||
PORT = int(os.environ.get("UPLOAD_PORT", "8081"))
|
||||
DATA_ROOT = "/app/data"
|
||||
|
||||
class Handler(http.server.BaseHTTPRequestHandler):
|
||||
def do_PUT(self):
|
||||
dest = DATA_ROOT + self.path.rstrip("/")
|
||||
path = urllib.parse.unquote(self.path)
|
||||
dest = DATA_ROOT + path.rstrip("/")
|
||||
os.makedirs(dest, exist_ok=True)
|
||||
length = int(self.headers.get("Content-Length", 0))
|
||||
body = self.rfile.read(length)
|
||||
|
||||
Reference in New Issue
Block a user