(r *http.Request)
| 127 | } |
| 128 | |
| 129 | func allowDebugAccessWithKey(r *http.Request) bool { |
| 130 | if r.Method != "GET" { |
| 131 | return false |
| 132 | } |
| 133 | urlKey := r.FormValue("debugkey") |
| 134 | keyPath := envknob.String("TS_DEBUG_KEY_PATH") |
| 135 | if urlKey != "" && keyPath != "" { |
| 136 | slurp, err := os.ReadFile(keyPath) |
| 137 | if err == nil && string(bytes.TrimSpace(slurp)) == urlKey { |
| 138 | return true |
| 139 | } |
| 140 | } |
| 141 | return false |
| 142 | } |
| 143 | |
| 144 | // AcceptsEncoding reports whether r accepts the named encoding |
| 145 | // ("gzip", "br", etc). |
no test coverage detected
searching dependent graphs…