use TrimPrefix instead of TrimLeft

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
This commit is contained in:
Somtochi Onyekwere 2023-08-01 16:31:15 +01:00
parent 04fbfaeb6c
commit 4f5d2dfdb8
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ func IndexReceiverWebhookPath(o client.Object) []string {
func (s *ReceiverServer) handlePayload() func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
ctx := context.Background()
digest := url.PathEscape(strings.TrimLeft(r.RequestURI, apiv1.ReceiverWebhookPath))
digest := url.PathEscape(strings.TrimPrefix(r.RequestURI, apiv1.ReceiverWebhookPath))
s.logger.Info(fmt.Sprintf("handling request: %s", digest))