[client-python] Strip trailing slash from URL before building API endpoint (#15973)#15972
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #15972 +/- ##
=======================================
Coverage 34.49% 34.49%
=======================================
Files 3254 3254
Lines 220135 220135
Branches 40872 40873 +1
=======================================
+ Hits 75935 75938 +3
+ Misses 144200 144197 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ncarenton
approved these changes
May 12, 2026
…point requests 2.34.0 (#7315) no longer normalizes duplicate leading slashes in URI paths. When OPENCTI_URL ends with '/', the naive concatenation url + '/graphql' produces '//graphql', which the server rejects as 'Path not found'. Using url.rstrip('/') ensures a clean path regardless of the requests version.
ac36cbe to
0597f34
Compare
aHenryJard
approved these changes
May 13, 2026
aHenryJard
left a comment
Member
There was a problem hiding this comment.
Tested locally with a pycti script and using and api_url with 2 // at the end, working all fine.
Also tested with a not empty base_path on opencti.
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.
requests 2.34.0 (psf/requests#7315) no longer normalizes duplicate leading slashes in URI paths. When OPENCTI_URL ends with '/', the naive concatenation url + '/graphql' produces '//graphql', which the server rejects as 'Path not found'. Using url.rstrip('/') ensures a clean path regardless of the requests version.
Proposed changes
Related issues
Checklist
Further comments