jpillora / jpillora/chisel

Respond to /health and /version by request path rather than the whole url string

Open
#327 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
16.6k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Request for /health?_t=anything won't return the health info, neither would request for /version if there exists extra query string.

Can we route the /health and /version by request path instead of the whole url string? I can make a pull request if it's okay.

substitute the switch r.URL.String() with switch r.URL.Path:

switch r.URL.Path {
case "/health":
	w.Write([]byte("OK\n"))
	return
case "/version":
	w.Write([]byte(chshare.BuildVersion))
	return
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in server/server_handler.go at the switch currently using r.URL.String(). Check how the /health and /version handlers behave when the request includes a query string. Done means both endpoints return their existing health or version responses regardless of extra query parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.