Skip to content

Generate HTTPS URLs by default in cld url - #123

Merged
const-cloudinary merged 1 commit into
masterfrom
fix/url-https-by-default
Sep 27, 2026
Merged

const-cloudinary merged 1 commit into
masterfrom
fix/url-https-by-default

Conversation

@TalLevAmi

Copy link
Copy Markdown
Contributor

cld url sample returned http://res.cloudinary.com/.... The Upload and Admin API responses give both url and secure_url, but cld url gave only the HTTP form. Users copy these URLs into pages and share them, so HTTPS must be the default.

Brief Summary of Changes

  • The url command (cloudinary_cli/core/utils.py) passes secure=True to cloudinary_url when cloudinary.config().secure is None.
  • When the configuration sets secure (for example CLOUDINARY_URL=cloudinary://...?secure=true), the command uses that value.
  • cld utils cloudinary_url does not change. It is a direct call to the SDK method.

What does this PR address?

  • GitHub issue (Add reference - #XX)
  • Refactoring
  • New feature
  • Bug fix
  • Adds more tests

Are tests included?

  • Yes
  • No

Reviewer, please note:

  • This changes the output of cld url. Please add it to the changelog of the next release.
  • ?secure=false in CLOUDINARY_URL gives HTTPS on master too: the SDK stores the value as the string 'false', which is truthy. This PR does not change that SDK behavior.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I ran the full test suite before pushing the changes and all the tests pass.

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.py and test_cli_config_oauth.py fail with stderr not separately captured on this branch and on master too. These tests need Click 8.2, which needs Python 3.10 or later. CI must confirm the full result.

🤖 Generated with Claude Code

`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>
@TalLevAmi
TalLevAmi marked this pull request as ready for review September 26, 2026 16:15
@const-cloudinary
const-cloudinary merged commit 4ccef90 into master Sep 27, 2026
8 checks passed
@const-cloudinary
const-cloudinary deleted the fix/url-https-by-default branch September 27, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants