fix: two-user model bug fixes and docs
This commit is contained in:
+2
-2
@@ -5,6 +5,7 @@ Communicates with vacuum-walld over a Unix socket using requests-unixsocket.
|
||||
|
||||
import json
|
||||
import logging
|
||||
import urllib.parse
|
||||
from typing import Any
|
||||
|
||||
import requests
|
||||
@@ -64,12 +65,11 @@ def request(
|
||||
Raises NotFound on HTTP 404. Raises BadRequest on HTTP 400.
|
||||
"""
|
||||
sp = socket_path or _get_socket_path()
|
||||
url = f"http://localhost{path}"
|
||||
url = f"http+unix://{urllib.parse.quote(sp, safe='')}{path}"
|
||||
sess = requests_unixsocket.Session()
|
||||
try:
|
||||
kwargs: dict[str, Any] = {
|
||||
"timeout": timeout,
|
||||
"unix_socket": sp,
|
||||
}
|
||||
if method == "GET":
|
||||
if query_params:
|
||||
|
||||
+1
-1
@@ -250,7 +250,7 @@ def create_app() -> web.Application:
|
||||
app = web.Application()
|
||||
app.router.add_route("GET", "/health", _health)
|
||||
app.router.add_route("POST", "/batch", _handle_batch)
|
||||
app.router.add_route("{tail:.*}", _catch_all)
|
||||
app.router.add_route("*", "/{tail:.*}", _catch_all)
|
||||
return app
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user