/logs.json and /health URLs do not work if log prefix is /

オープン 初心者向け
#75 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
api, backend

調査の方向性

まず、コミット 71b4f80 で変更された HTTP ハンドラーの設定を読み、ルートプレフィックス用のログごとのハンドラーが /logs.json および /health のルートとどのように相互作用するかを追ってください。ログプレフィックスを / にして 404 を再現し、その後、ログごとのルートが引き続き機能する状態で、両方の URL が正常に応答することを確認してください。

索引モデルが issue の本文から書いたものです。

説明

We are getting HTTP 404 Not Found responses for /logs.json and /health URLs on our monitoring servers with Skylight v0.10.1.

Our log prefix is / and it seems that go http ServerMux prefers per-log HandleFunc with specified host and / path over global /logs.json and /health HandleFuncs. If logs have non-root prefix path, there is no conflict between per-log and global HandleFuncs, but there is if log prefix path is /.

I think this regression is introduced in v0.9.0 with commit 71b4f80 (cmd/skylight: implement c2sp.org/tlog-mirror read path) where ServerMux handlers got reworked. Before that HandleFunc patterns were more specific and not conflicted with /logs.json and /health, but with a per-log HandleFunc multiplexer the common per-log path became / in our case and that became more specific that /logs.json and /health.

主要言語
Go
スター
318
フォーク
32
平均マージ
5分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FiloSottile/sunlight のほかの issue

FiloSottile/sunlight の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。