refactor(git-http): rename variable to indicate configurability
This commit was merged in pull request #144.
This commit is contained in:
@@ -20,7 +20,7 @@ from urllib.parse import urlsplit
|
||||
DEFAULT_PORT = 9420
|
||||
|
||||
# Body-size cap matching supervise_server.py's 1 MiB limit.
|
||||
_MAX_BODY_BYTES = 1 * 1024 * 1024
|
||||
MAX_BODY_BYTES = 1 * 1024 * 1024
|
||||
|
||||
|
||||
class GitHttpHandler(BaseHTTPRequestHandler):
|
||||
@@ -88,7 +88,7 @@ class GitHttpHandler(BaseHTTPRequestHandler):
|
||||
if length < 0:
|
||||
self.send_error(400, "Negative Content-Length")
|
||||
return
|
||||
if length > _MAX_BODY_BYTES:
|
||||
if length > MAX_BODY_BYTES:
|
||||
self.send_error(413, "Request body too large")
|
||||
return
|
||||
body = self.rfile.read(length) if length else b""
|
||||
|
||||
Reference in New Issue
Block a user