mirror of
https://github.com/smittix/intercept.git
synced 2026-06-08 06:01:56 -07:00
fix(maps): exclude stadia key from localStorage cache
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -226,8 +226,12 @@ const Settings = {
|
||||
async _save(key, value) {
|
||||
this._cache[key] = value;
|
||||
|
||||
// Save to localStorage as backup
|
||||
localStorage.setItem('intercept_settings', JSON.stringify(this._cache));
|
||||
// Save to localStorage as backup (exclude sensitive keys)
|
||||
const SENSITIVE_KEYS = ['offline.stadia_key'];
|
||||
const toStore = Object.fromEntries(
|
||||
Object.entries(this._cache).filter(([k]) => !SENSITIVE_KEYS.includes(k))
|
||||
);
|
||||
localStorage.setItem('intercept_settings', JSON.stringify(toStore));
|
||||
|
||||
// Save to server
|
||||
try {
|
||||
|
||||
@@ -34,8 +34,8 @@ def test_stadia_key_can_be_saved(auth_client):
|
||||
assert data["value"] == "test-key-123"
|
||||
|
||||
|
||||
def test_stadia_key_rejects_non_string(auth_client):
|
||||
"""POST /offline/settings rejects non-string stadia_key."""
|
||||
def test_stadia_key_coerces_non_string(auth_client):
|
||||
"""POST /offline/settings coerces non-string stadia_key to string."""
|
||||
resp = auth_client.post("/offline/settings", json={"key": "offline.stadia_key", "value": 42})
|
||||
# Should coerce to string '42' (type matches str default) — not 400
|
||||
assert resp.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user