fix(backend): allow non-numeric SKU IDs for legacy Windows products #10
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: shekhar/windows-iso-downloader#10
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/cf-worker-proxy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaced strconv.Atoi on sku_id with a permissive allowlist regex (alphanumeric, hyphens, underscores). Older products like Windows 8.1 (#48, #52) return non-integer SKU IDs from Microsoft API, causing the Get Download Links button to fail with 'sku_id must be a numeric value'.
Closes #9
Summary by CodeRabbit
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
9d518034-ec2e-42b1-9056-55a7ddd309e7📥 Commits
Reviewing files that changed from the base of the PR and between
2e2f9c5c48and106e2e2b31.📒 Files selected for processing (1)
backend/main.go📝 Walkthrough
Walkthrough
The PR replaces numeric-only validation of the
sku_idparameter in the/proxyendpoint with a regex-based character allowlist. A compiled regexvalidSkuIDis added to permit alphanumeric characters, underscores, and hyphens, allowing non-integer SKU IDs such as GUIDs and locale strings to pass validation.Changes
SKU ID Validation
backend/main.govalidSkuIDmatching^[a-zA-Z0-9_\-]+$is introduced at the package level. The/proxyendpoint'ssku_idvalidation replacesstrconv.Atoinumeric parsing with a regex match check, returning400with"sku_id contains invalid characters"on mismatch.Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
/proxyendpoint'ssku_idvalidation logic; PR#2enforces numeric-only validation while this PR permits alphanumeric and special characters via regex.Poem
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
feat/cf-worker-proxyComment
@coderabbitai helpto get the list of available commands and usage tips.