Skip to content

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

@BigSully

Description

@BigSully

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions