Skip to content

Commit

Permalink
Merge pull request #2 from dBildungsplattform/integrate-auth
Browse files Browse the repository at this point in the history
Fixed if condition
  • Loading branch information
dimapin authored Sep 2, 2024
2 parents 45fa323 + e8942d0 commit a9ccd68
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 a9ccd68

Please sign in to comment.