diff --git a/INSTALL.md b/INSTALL.md index c4ccdcc3..1b3ebbae 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -159,13 +159,14 @@ the one in the `config.yaml`, so that client knows how to access the backend! server { listen 80; server_name great.dude; - merge_slashes off; # to support post tags such as /// location ~ ^/api$ { return 302 /api/; } location ~ ^/api/(.*)$ { - proxy_pass http://127.0.0.1:6666/$1$is_args$args; + if ($request_uri ~* "/api/(.*)") { # preserve PATH_INFO as-is + proxy_pass http://127.0.0.1:6666/$1; + } } location / { root /home/rr-/src/maintained/szurubooru/client/public; diff --git a/client/js/util/uri.js b/client/js/util/uri.js index 52e90a06..a0482280 100644 --- a/client/js/util/uri.js +++ b/client/js/util/uri.js @@ -24,11 +24,11 @@ function formatApiLink(...values) { } function escapeParam(text) { - return encodeURIComponent(text).replace(/%/g, '$'); + return encodeURIComponent(text); } function unescapeParam(text) { - return decodeURIComponent(text.replace(/\$/g, '%')); + return decodeURIComponent(text); } function formatClientLink(...values) { diff --git a/server/szurubooru/rest/app.py b/server/szurubooru/rest/app.py index 0823e6e3..b4d23d42 100644 --- a/server/szurubooru/rest/app.py +++ b/server/szurubooru/rest/app.py @@ -31,7 +31,7 @@ def _get_headers(env): def _create_context(env): method = env['REQUEST_METHOD'] - path = urllib.parse.unquote('/' + env['PATH_INFO'].lstrip('/')) + path = '/' + env['PATH_INFO'].lstrip('/') headers = _get_headers(env) files = {}