Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[URLEncode] Add safe argument to URLEncode script #26582

Merged
merged 20 commits into from May 21, 2023

Conversation

samuelFain
Copy link
Contributor

@samuelFain samuelFain commented May 17, 2023

Contributing to Cortex XSOAR Content

Make sure to register your contribution by filling the contribution registration form

The Pull Request will be reviewed only after the contribution registration form is filled.

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

fixes: https://jira-hq.paloaltonetworks.local/browse/XSUP-24291

Description

This PR is a fix to this issue, which utilizes urllib.parse.quote function's safe argument using a new safe_character script argument, that specifies additional ASCII characters that should not be quoted — its default value is "/".
There is another new argument called ignore_safe_character which allows ignoring the safe character functionality (and encode the entire URL).

Screenshots

Using the following URL as example input: https://supportcases.paloaltonetworks.com/s/casedetail?Id=5004u00002ttOBkAAM

OOTB script configuration, gives the same results as the original script (not breaking BC):
image
Results:
image


ignore_safe_character argument set to 'true' ignores safe argument and encodes default special character '/':
image
Results:
image

Minimum version of Cortex XSOAR

  • 6.0.0
  • 6.1.0
  • 6.2.0
  • 6.5.0

Does it break backward compatibility?

  • Yes
    • Further details:
  • No

Must have

  • Tests
  • Documentation

@samuelFain samuelFain changed the title Add safe argument to URLEncode script [URLEncode] Add safe argument to URLEncode script May 17, 2023
@samuelFain samuelFain marked this pull request as ready for review May 17, 2023 14:19
@samuelFain samuelFain self-assigned this May 17, 2023
Copy link
Contributor

@ShacharKidor ShacharKidor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! :)

@samuelFain samuelFain merged commit 0a02f19 into master May 21, 2023
14 checks passed
@samuelFain samuelFain deleted the feature/no-ref/url_encode-script-add-safe-argument branch May 21, 2023 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants