Generate HTTPS URLs by default in cld url - #123
Merged
Merged
Conversation
`cld url sample` returned `http://res.cloudinary.com/...`. The SDK uses HTTP unless the configuration sets `secure`. Pass `secure=True` to `cloudinary_url` when the configuration does not set `secure`. A configuration that sets `secure` keeps its value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
cld url samplereturnedhttp://res.cloudinary.com/.... The Upload and Admin API responses give bothurlandsecure_url, butcld urlgave only the HTTP form. Users copy these URLs into pages and share them, so HTTPS must be the default.Brief Summary of Changes
urlcommand (cloudinary_cli/core/utils.py) passessecure=Truetocloudinary_urlwhencloudinary.config().secureisNone.secure(for exampleCLOUDINARY_URL=cloudinary://...?secure=true), the command uses that value.cld utils cloudinary_urldoes not change. It is a direct call to the SDK method.What does this PR address?
Are tests included?
Reviewer, please note:
cld url. Please add it to the changelog of the next release.?secure=falseinCLOUDINARY_URLgives HTTPS onmastertoo: the SDK stores the value as the string'false', which is truthy. This PR does not change that SDK behavior.Checklist:
Local test run: I ran the full suite on Python 3.8 with Click 8.1.8. The new tests pass, and they fail without the fix. 8 tests in
test_cli_agent.pyandtest_cli_config_oauth.pyfail withstderr not separately capturedon this branch and onmastertoo. These tests need Click 8.2, which needs Python 3.10 or later. CI must confirm the full result.🤖 Generated with Claude Code