Skip to content

Commit

Permalink
Fixed if condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dimapin committed Sep 2, 2024
1 parent 44a406f commit e8942d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ func main() {
router := http.NewServeMux()
router.HandleFunc("/clammit", infoHandler)
if bytes.Equal(secretKey, []byte("secret-key")) {
router.HandleFunc("/clammit/scan", scanHandler)
} else {
authenticatedScanHandler := checkAuthentication(http.HandlerFunc(scanHandler))
router.HandleFunc("/clammit/scan", func(w http.ResponseWriter, r *http.Request) {
authenticatedScanHandler.ServeHTTP(w, r)
})
} else {
router.HandleFunc("/clammit/scan", scanHandler)
}
router.HandleFunc("/clammit/readyz", readyzHandler)

Expand Down

0 comments on commit e8942d0

Please sign in to comment.