Skip to content

Commit

Permalink
Fix bug on sanitizing params (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
bariqhibat committed Oct 6, 2021
1 parent 9031297 commit 3e7b60e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion postgrest_py/utils.py
@@ -1,7 +1,7 @@
def sanitize_param(param: str) -> str:
reserved_chars = ",.:()"
if any(char in param for char in reserved_chars):
return f'"{param}"'
return f'%22{param}%22'
return param


Expand Down
2 changes: 1 addition & 1 deletion tests/test_filter_request_builder.py
Expand Up @@ -27,7 +27,7 @@ def test_not_(filter_request_builder):
def test_filter(filter_request_builder):
builder = filter_request_builder.filter(":col.name", "eq", "val")

assert builder.session.params['":col.name"'] == "eq.val"
assert builder.session.params['%22:col.name%22'] == "eq.val"


def test_multivalued_param(filter_request_builder):
Expand Down

0 comments on commit 3e7b60e

Please sign in to comment.