feat: trim space on webhook url (#4411)

This commit is contained in:
ProjectOrangeJuice
2025-02-17 02:16:01 +00:00
committed by GitHub
parent 174b8b048a
commit 9f25bb2034

View File

@@ -3,6 +3,7 @@ package v1
import (
"context"
"fmt"
"strings"
"time"
"google.golang.org/grpc/codes"
@@ -23,7 +24,7 @@ func (s *APIV1Service) CreateWebhook(ctx context.Context, request *v1pb.CreateWe
webhook, err := s.Store.CreateWebhook(ctx, &store.Webhook{
CreatorID: currentUser.ID,
Name: request.Name,
URL: request.Url,
URL: strings.TrimSpace(request.Url),
})
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to create webhook, error: %+v", err)