Skip to content

Commit 93613f0

Browse files
committed
fix(datasource): apply defaults on copy of coerced request
1 parent 97c5610 commit 93613f0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

polytope_server/common/datasource/datasource.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# does it submit to any jurisdiction.
1919
#
2020

21+
import copy
2122
import logging
2223
from abc import ABC
2324
from importlib import import_module
@@ -66,6 +67,7 @@ def match(ds_config, coerced_ur: Dict[str, Any], user: User) -> str:
6667
if roles and not user.has_access(roles):
6768
return f"Skipping datasource {DataSource.repr(ds_config)}: user not authorized."
6869

70+
coerced_ur = copy.deepcopy(coerced_ur) # don't want to modify the original request
6971
# apply defaults
7072
defaults = ds_config.get("defaults", {})
7173
if "date" not in defaults:

0 commit comments

Comments
 (0)