1
0
mirror of https://github.com/sredevopsorg/deepseek-kubernetes-sandbox.git synced 2026-11-03 01:13:24 +00:00

Forward the upstream query byte-for-byte (#8)

filtered_query() round-tripped the query through parse_qsl/urlencode, which
percent-encoded DSH's Vite-style combined-module URLs. The client asks for
"plugins/??@deepseek-ai/dsh-client-modules/client.js&rev=..." - the raw query
itself starts with "?" - so the gateway sent "%3F%40deepseek-ai..." and the
upstream answered 404. The browser then failed the boot with:

  client-modules: HTML did not preload
  @deepseek-ai/dsh-client-modules/client.js

Strip only token parameters and keep every other raw part untouched. Add
regression tests for the combined-module URL and an encoded token key.

Co-authored-by: SREDevOpsAgents <agents@sredevops.org>
This commit is contained in:
SREDevOps.org Agent
2026-10-21 14:24:01 -03:00
committed by GitHub
parent 9dea4a7f67
commit 687640621e
2 changed files with 37 additions and 8 deletions

View File

@@ -389,6 +389,17 @@ def test_filtered_query_removes_token_only():
assert filtered_query("a=1&token=x&b=2&token=y") == "a=1&b=2"
def test_filtered_query_preserves_vite_combined_module_url():
"""DSH's ``plugins/??<specifiers>`` query must reach the upstream verbatim."""
raw = "?@deepseek-ai/dsh-client-modules/client.js&rev=a1bf7d6a56f9"
assert filtered_query(raw) == raw
assert filtered_query(raw + "&token=x") == raw
def test_filtered_query_drops_an_encoded_token_parameter():
assert filtered_query("a=1&to%6Ben=x&b=2") == "a=1&b=2"
def test_token_matches_is_timing_safe_hash_check():
claim = {
"metadata": {