Error() methods modify the request URL of the response they wrap
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- go
調査の方向性
The issue identifies sanitizeURL in github/github.go and the Error() methods that pass it request URLs. Start by reading sanitizeURL and inspect the existing tests for these error types. Done means formatting the errors leaves the original URL unchanged, with a test covering that behavior; a linked pull request is already open.
索引モデルが issue の本文から書いたものです。
説明
sanitizeURL in github/github.go updates uri.RawQuery on the *url.URL it receives. ErrorResponse.Error(), RateLimitError.Error(), AbuseRateLimitError.Error() and RedirectionError.Error() pass it r.Response.Request.URL (and r.Location) directly, so just formatting the error rewrites the caller's request URL.
u, _ := url.Parse("https://api.github.com/x?access_token=secret")
e := &github.ErrorResponse{Response: &http.Response{Request: &http.Request{Method: "GET", URL: u}, StatusCode: 404}}
_ = e.Error()
fmt.Println(u) // https://api.github.com/x?access_token=REDACTED
Effects:
- After an error is logged,
resp.Request.URLno longer holds the URL that was sent, so code that reads or reuses it (for example to retry) getsREDACTEDvalues. - Calling
Error()on the same error from two goroutines is a data race, because a "read-only" method writes to shared state.
Proposed fix: have sanitizeURL redact a copy of the URL and leave the input alone, plus a test that checks the input is unchanged.
I'm planning to work on this and send a PR, if it can be assigned to me.
AI disclosure: an AI tool helped find this and write this issue.
- 主要言語
- Go
- スター
- 11.3k
- フォーク
- 2.6k
- 平均マージ
- 2日 14時間
- マージ済み PR(30日)
- 33
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/go-github のほかの issue
-
Add support for force-cancel and approve workflow run endpoints対応中かも @Shudharshan07 が今日担当しました。 オープン
google/go-github#4661 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Rate-limit retry replays a consumed request body for POST/PUT/PATCH対応中かも @AdamMagued が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
google/go-github#4656 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
otel: redact sensitive query parameters before recording http.url対応中かも @sai5880 が 1 日前に担当しました。 オープン
難易度 4/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
Add support for Copilot coding agent permissions API対応中かも @ninadsutrave が 2 日前に担当しました。 オープン
google/go-github#4650 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 5/100
google/go-github#4636 · コメント 7 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
google/go-github の issue をすべて見る
似ている issue
-
confirmed enhancement go
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
DennisVlaanderen/aerendil#154 ·
メンテナーはふだん 1 日以内に返信
-
Generated README and SKILL omit HTTP-transport security settings and what local data the CLI keepsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
mvanhorn/cli-printing-press#5181 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 83/100
Adyen/agent-marketplace#922 ·
メンテナーはふだん 1 日以内に返信
-
filer.remote.sync writes the S3 bucket-owner index (<buckets>/.system/owners/...) to remote storageオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信