Skip to content

refactor: centralize url construction - #1

Merged
devbydaniel merged 9 commits into
mainfrom
auto-claude/005-url-handling-robustness
Jan 31, 2026
Merged

devbydaniel merged 9 commits into
mainfrom
auto-claude/005-url-handling-robustness

Conversation

@devbydaniel

Copy link
Copy Markdown
Owner

Audit and fix all URL construction and parsing logic across the codebase. Standardize URL handling with a utility module that correctly handles base URLs, trailing slashes, and protocol prefixes.

devbydaniel and others added 9 commits January 31, 2026 19:48
…rmalizat

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ility covering all edge cases

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…se URL utility

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Created comprehensive verification program and report for URL utility edge cases.

- Created backend/cmd/url-verify/main.go verification program
- Tests 8 different BASE_URL configurations (trailing slash, no slash, port, subpath, etc.)
- Verifies 5 real-world use cases (email, password reset, invites, release pages, image proxy)
- Validates 3 edge case checks (no double slashes, protocol present, no trailing slash)
- All 64 test cases passed (100% success rate)
- Created detailed verification report documenting all results

Verified configurations:
✓ With/without trailing slash
✓ With/without protocol
✓ With port numbers
✓ With subpaths
✓ Complex combinations (port + subpath + trailing slash)
✓ Localhost special handling (http vs https)

All acceptance criteria met. Ready for production.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@devbydaniel
devbydaniel merged commit ac0febd into main Jan 31, 2026
@devbydaniel
devbydaniel deleted the auto-claude/005-url-handling-robustness branch January 31, 2026 19:30
devbydaniel added a commit that referenced this pull request Jan 31, 2026
…e config, fix race condition (qa-requested)

Fixes:
- Issue #1: Fixed inverted cost calculation formula (PublicMaxTokens / PublicRequestsPerInterval)
- Issue #2: Cache config in init() instead of creating on every request
- Issue #3: Add mutex to protect buckets map from concurrent access
- Issue #4: Add config validation for rate limit values

Verified:
- Cost calculation now correctly limits requests to configured value
- Config loaded only once at startup instead of per-request
- Map access protected with sync.RWMutex and double-check pattern
- Invalid config values (<=0) will panic at startup with clear error

QA Fix Session: 1

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

1 participant