Fix QA nits from PR #5: DomainID type, io.ReadAll limit, variable naming #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Type
Bug
Lineage
Follow-up from PR #5 QA review. Non-blocking nits that should be cleaned up.
Repo
ldraney/godaddy-tofuWhat Broke
Three code quality issues identified during QA re-review of PR #5:
Domain.DomainIDisfloat64but should beint64— swagger spec says integer.float64can lose precision on large IDs.io.ReadAllin error path has no size limit —client.go:67reads the entire error response body with no cap. A malformed response could exhaust memory.ListDomainslocal variableurlshadowsnet/urlimport —domains.go:38still usesurlas local var name, inconsistent with thereqURLnaming applied in the encoding fix (commit4a97205).Repro Steps
pkg/godaddy/domains.go—DomainIDisfloat64,ListDomainsusesurlnotreqURLpkg/godaddy/client.go—io.ReadAllat line 67 has no size limitExpected Behavior
DomainIDshould beint64io.LimitReader(resp.Body, 1<<20))reqURLconsistentlyEnvironment
pkg/godaddy/client code on main branch after PR #5 mergeFile Targets
pkg/godaddy/domains.go— fixDomainIDtype, renameurltoreqURLinListDomainspkg/godaddy/client.go— wrapio.ReadAllwithio.LimitReaderAcceptance Criteria
Domain.DomainIDisint64reqURLconsistentlygo build ./...andgo vet ./...passConstraints
Related