Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
Make it a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Sep 9, 2020
1 parent cffdf4e commit 1459c28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/controller/middleware/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import (
"github.com/gorilla/mux"
)

const HeaderDebug = "x-debug"

// ProcessDebug adds additional debugging information to the response if the
// request included the "X-Debug" header with any value.
func ProcessDebug(ctx context.Context) mux.MiddlewareFunc {
header := "x-debug"

return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Header.Get(header) != "" {
if r.Header.Get(HeaderDebug) != "" {
w.Header().Set("x-build-id", buildinfo.BuildID)
w.Header().Set("x-build-tag", buildinfo.BuildTag)
}
Expand Down

0 comments on commit 1459c28

Please sign in to comment.