Fix GET validation for lowercase http methods (#2497)
Some requests send method in lowercase (verified with curl and as a default for AWS ALB health check requests), but Go HTTP library constant MethodGet is in upper.
This commit is contained in:
parent
04fb9f4fa1
commit
a2d4b95b79
|
|
@ -115,7 +115,7 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) Handle(w http.Respons
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// respond ok to GET / e.g. for health check
|
// respond ok to GET / e.g. for health check
|
||||||
if r.Method == http.MethodGet {
|
if strings.ToUpper(r.Method) == http.MethodGet {
|
||||||
ok = true
|
ok = true
|
||||||
fmt.Fprintln(w, "webhook server is running")
|
fmt.Fprintln(w, "webhook server is running")
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue