File tree Expand file tree Collapse file tree 2 files changed +0
-28
lines changed
Expand file tree Collapse file tree 2 files changed +0
-28
lines changed Original file line number Diff line number Diff line change @@ -40,23 +40,3 @@ def test_sanitized_url():
4040 src = "http://localhost/foo.bar.baz"
4141 dest = "http://localhost/foo%2Ebar%2Ebaz"
4242 assert dest == utils .sanitized_url (src )
43-
44-
45- def test_sanitize_parameters_does_nothing ():
46- assert 1 == utils .sanitize_parameters (1 )
47- assert 1.5 == utils .sanitize_parameters (1.5 )
48- assert "foo" == utils .sanitize_parameters ("foo" )
49-
50-
51- def test_sanitize_parameters_slash ():
52- assert "foo%2Fbar" == utils .sanitize_parameters ("foo/bar" )
53-
54-
55- def test_sanitize_parameters_slash_and_percent ():
56- assert "foo%2Fbar%25quuz" == utils .sanitize_parameters ("foo/bar%quuz" )
57-
58-
59- def test_sanitize_parameters_dict ():
60- source = {"url" : "foo/bar" , "id" : 1 }
61- expected = {"url" : "foo%2Fbar" , "id" : 1 }
62- assert expected == utils .sanitize_parameters (source )
Original file line number Diff line number Diff line change @@ -60,14 +60,6 @@ def clean_str_id(id: str) -> str:
6060 return quote (id , safe = "" )
6161
6262
63- def sanitize_parameters (value ):
64- if isinstance (value , dict ):
65- return dict ((k , sanitize_parameters (v )) for k , v in value .items ())
66- if isinstance (value , str ):
67- return quote (value , safe = "" )
68- return value
69-
70-
7163def sanitized_url (url : str ) -> str :
7264 parsed = urlparse (url )
7365 new_path = parsed .path .replace ("." , "%2E" )
You can’t perform that action at this time.
0 commit comments