URLDecode
Converts https:%2F%2Fexample.com into https://example.com
python · Filters And Transformers
Details
| ID | URLDecode |
|---|---|
| Language | python |
| From Version | 5.0.0 |
| Docker Image | demisto/python3:3.12.13.10404775 |
| Tags | transformer |
README
Converts “https:%2F%2Fexample.com” into “https://example.com”.
Script Data
| Name | Description |
|---|---|
| Script Type | python |
| Tags | transformer |
Inputs
| Argument Name | Description |
|---|---|
| value | The URL to input. |
Outputs
| Path | Description | Type |
|---|---|---|
| DecodedURL | The parsed URL as a key/value. | string |
import pytest from CommonServerPython import * from URLDecode import main @pytest.mark.parametrize( "url,res", [ ("https:%2F%2Fexample.com", "https://example.com"), ("https://example.com/?test%20this", "https://example.com/?test this"), ], ) def test_main(mocker, url, res): mocker.patch.object(demisto, "args", return_value={"value": url}) mocker.patch.object(demisto, "results") main() results = demisto.results.call_args[0] assert results[0]["HumanReadable"] == res assert results[0]["Contents"]["DecodedURL"] == res