diff options
| author | UltraQbik <no1skill@yandex.ru> | 2024-08-23 21:09:31 +0300 |
|---|---|---|
| committer | UltraQbik <no1skill@yandex.ru> | 2024-08-23 21:09:31 +0300 |
| commit | ac08c5e84153160f8221b30854a9b7029b8c3fe2 (patch) | |
| tree | e902f6a095996c864b6abf4f9c0929a395053e81 /src/APIv1.py | |
| parent | fb24bdfccedcc95e9cdfb97db375120933bb451c (diff) | |
| download | httpy-ac08c5e84153160f8221b30854a9b7029b8c3fe2.tar.gz httpy-ac08c5e84153160f8221b30854a9b7029b8c3fe2.zip | |
Update API
Diffstat (limited to 'src/APIv1.py')
| -rw-r--r-- | src/APIv1.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/APIv1.py b/src/APIv1.py index 882a13d..c9ba2da 100644 --- a/src/APIv1.py +++ b/src/APIv1.py @@ -65,13 +65,11 @@ def api_call(client: SSLSocket, request: Request) -> Response: """ # decode API request - split_path = request.path.split("/") - api_level1 = split_path[2] - api_request = split_path[3] + split_path = request.path.split("/", maxsplit=16)[1:] # do something with it (oh god) - if api_level1 == "file": - if api_request == "random": + if len(split_path) > 1 and split_path[1] == "file": + if len(split_path) > 2 and split_path[2] == "random": # get size size_str = request.path_args.get("size", "16mib") size = decode_size(size_str) |