Skip to content

Commit 300427c

Browse files
vipulnswardclaude
andcommitted
refactor: simplify CnameGenerator by using custom_cname directly
Replace generate_cname call with direct custom_cname usage in cdn_base_postfix to reduce method indirection, addressing CodeRabbit review suggestion. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 16ed347 commit 300427c

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.claude/settings.local.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(node:*)",
5+
"Bash(npm:*)",
6+
"WebFetch(domain:github.com)",
7+
"Bash(gh pr view:*)",
8+
"Bash(gh pr diff:*)",
9+
"WebFetch(domain:docs.anthropic.com)",
10+
"Bash(git fetch:*)",
11+
"Bash(git checkout:*)"
12+
],
13+
"deny": []
14+
}
15+
}

lib/uploadcare/cname_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class << self
1313
def cdn_base_postfix
1414
@cdn_base_postfix ||= begin
1515
uri = URI.parse(Uploadcare.config.cdn_base_postfix)
16-
uri.host = "#{generate_cname}.#{uri.host}"
16+
uri.host = "#{custom_cname}.#{uri.host}"
1717
uri.to_s
1818
rescue URI::InvalidURIError => e
1919
raise Uploadcare::Exception::ConfigurationError, "Invalid cdn_base_postfix URL: #{e.message}"

0 commit comments

Comments
 (0)