Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4605 +/- ##
=======================================
Coverage 98.61% 98.62%
=======================================
Files 199 199
Lines 18664 18668 +4
=======================================
+ Hits 18406 18411 +5
+ Misses 258 257 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Is this PR fixing a hypothetical issue that has never been emperically found in the wild, or has this problem ever been actually seen when using this client library? When would a relative URL ever be returned by GitHub? How has this client library been working for decades without ever encountering a relative URL? |
|
Thanks for asking. I do not have a production capture showing GitHub.com returned a relative The protocol permits it: RFC 9110 §10.2.2 defines I also addressed the Codecov line by parsing each Location once, checking traversal on the parsed URL, and covering malformed values. After syncing current |
|
Thanks for the reply, @DorianChn, but I'm very uncomfortable with this change to a critical part of the client library without there being evidence-based reasons from actual GitHub v3 API usage. Closing. |
Summary
Why
Relative
Locationvalues are resolved against the responding request URL; using the API base URL can discard the endpoint path or return an unusable relative URL. This followshttp.Response.Location.Validation
bash script/test.sh ./...— all 11 modules passed.go vet ./...— passed.gofmtandgit diff --checkpassed.script/lint.shreached the generated-file check, which reports the localgo.sumCRLF/LF mismatch; no unrelated line-ending change is included.AI assistance
AI assistance helped draft the implementation and regression tests; the contributor reviewed the diff and ran the listed validations.