Skip to content

Commit

Permalink
fix: ssl_detected used from options if not configured before
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudinary-pkoniu committed Jul 20, 2023
1 parent 3b00b29 commit 78b3da1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,8 @@ function build_distribution_domain(source, options) {
throw new Error('Must supply cloud_name in tag or in configuration');
}

const ssl_detected = consumeOption(options, "ssl_detected", config().ssl_detected);
let secure = consumeOption(options, 'secure', config().secure);
let secure = consumeOption(options, 'secure', null);
const ssl_detected = consumeOption(options, 'ssl_detected', config().ssl_detected);
if (secure === null) {
secure = ssl_detected || config().secure;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/v2/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const Search = class Search {
const dataOrderedByKey = sort_object_by_key(clear_blank(query));
const encodedQuery = base64Encode(JSON.stringify(dataOrderedByKey));

const urlPrefix = build_distribution_domain(options);
const urlPrefix = build_distribution_domain(options.source, options);

const signature = compute_hash(`${urlTtl}${encodedQuery}${apiSecret}`, 'sha256', 'hex');

Expand Down

0 comments on commit 78b3da1

Please sign in to comment.