[Buganizer ID: 548190866] Fix: URL-encode OData $filter parameters for special characters - #1187
Open
pankjsingh-ind wants to merge 1 commit into
Conversation
When constructing 1Platform OData $filter query parameters in OnePlatformSoarApi (such as in get_traking_list_records_filtered and get_traking_list_record), parameters containing reserved characters (such as '&' in environment or category names) caused the web server to split the query string, resulting in 400 Bad Request or missing custom list records. This change applies urllib.parse.quote() to the OData $filter string so that reserved characters and special symbols are safely percent-encoded and preserved in the backend API request. Bug: b/548190866
pankjsingh-ind
force-pushed
the
fix-tipcommon-odata-special-char-encoding
branch
from
August 27, 2026 09:15
d42cada to
9cbc0dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes OData
$filterURL parameter construction inOnePlatformSoarApiby applyingurllib.parse.quote()to prevent reserved characters like&in custom list categories and environments from splitting query strings and triggering 400 Bad Request errors.What problem does this PR solve?
When querying 1Platform endpoints with OData
$filterexpressions (such as inget_traking_list_records_filtered,get_traking_list_record, andget_cases_by_timestamp_filter), parameters containing reserved URI characters (such as&in environment or category names) caused the web server to split the query string at the ampersand delimiter. This resulted in400 Client Error: Bad Requestor 0 records returned.How does this PR solve the problem?
Applied
urllib.parse.quote()to the$filterquery string inOnePlatformSoarApiso that reserved characters (&), spaces, and unicode symbols (e.g. umlauts) are safely percent-encoded (e.g.%26), preserving the full query filter intact across all network requests.Testing & Verification
test_get_traking_list_records_filtered_url_encodedandtest_get_traking_list_record_url_encodedintest_one_platform_soar_api.py.16/16 passed.&and umlauts (Indevis_Test_&_München).Checklist:
General Checks:
Open-Source Specific Checks:
For Google Team Members and Reviewers Only: