Skip to content

Commit

Permalink
ipn/localapi: require POST to add a bugreport marker
Browse files Browse the repository at this point in the history
The LocalClient.BugReport method already sends it via POST.

Updates tailscale/corp#7948

Change-Id: I98dbd558c99d4296d934baa5ebc97052c7413073
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
(cherry picked from commit a13753a)
  • Loading branch information
bradfitz authored and DentonGentry committed Nov 18, 2022
1 parent 5e65717 commit 7077adc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ipn/localapi/localapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ func (h *Handler) serveBugReport(w http.ResponseWriter, r *http.Request) {
http.Error(w, "bugreport access denied", http.StatusForbidden)
return
}
if r.Method != "POST" {
http.Error(w, "only POST allowed", http.StatusMethodNotAllowed)
return
}

logMarker := func() string {
return fmt.Sprintf("BUG-%v-%v-%v", h.backendLogID, time.Now().UTC().Format("20060102150405Z"), randHex(8))
Expand Down

0 comments on commit 7077adc

Please sign in to comment.