Repository navigation
Refuse dot-segment values for path parameters - #1535
Open
giri-kondisetty wants to merge 1 commit into
Open
giri-kondisetty wants to merge 1 commit into
giri-kondisetty wants to merge 1 commit into
Conversation
encode_path_segment() leaves a value of '.' or '..' unchanged, so the HTTP client removes it together with the preceding segment and the request goes to a shorter route. Percent-encoding the dots does not help because requests decodes them again before the path is normalized, so these values are refused.
giri-kondisetty
requested review from
alhumaw,
crowdstrikedcs and
jshcodes
as code owners
November 27, 2026 01:09
giri-kondisetty
force-pushed
the
fix/dot-segment-path-values
branch
from
November 27, 2026 02:19
f785493 to
b2c97fc
Compare
This branch has not been deployed
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.
Refuse dot-segment values for path parameters
encode_path_segment()left a value of.or..unchanged, so the HTTP client removed it together with the preceding segment and the request went to a shorter route. These two values are now refused with aValueError. Encoding the dots is not an option becauserequestsdecodes%2Eagain before the path is normalized.Unit test coverage
I could not run the full suite: most test modules need API credentials.
tests/test_path_encoding.pyis fully mocked and passes:$ pytest -q tests/test_path_encoding.py 15 passed in 0.14sThe changed lines in
encode_path_segment()are covered by the three new tests.Bandit analysis
flake8,pylint(10.00/10) andpydocstyleare clean forsrc/falconpy/_util.Issues resolved
..is not encoded and shortens the request route #1533 by refusing.and..inencode_path_segment().Other
.or..as a path identifier now gets aValueErrorwhere it used to get a request to a different route. I did not tick "Breaking Change" because neither value can be a valid identifier, but say so if you would rather return an error result.v1.2,...) are unchanged.