| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 916a7fe commit 443b934
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,23 +40,3 @@ def test_sanitized_url(): | |||
| 40 | 40 | src = "http://localhost/foo.bar.baz" | |
| 41 | 41 | dest = "http://localhost/foo%2Ebar%2Ebaz" | |
| 42 | 42 | 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: | |||
| 60 | 60 | return quote(id, safe="") | |
| 61 | 61 | ||
| 62 | 62 | ||
| 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 | - | ||
| 71 | 63 | def sanitized_url(url: str) -> str: | |
| 72 | 64 | parsed = urlparse(url) | |
| 73 | 65 | new_path = parsed.path.replace(".", "%2E") | |
| Back | FazBrowse Home | New Git URL |
0 commit comments