feat: trim space on webhook url (#4411)
This commit is contained in:
parent
174b8b048a
commit
9f25bb2034
1 changed files with 2 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ package v1
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"google.golang.org/grpc/codes"
|
"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{
|
webhook, err := s.Store.CreateWebhook(ctx, &store.Webhook{
|
||||||
CreatorID: currentUser.ID,
|
CreatorID: currentUser.ID,
|
||||||
Name: request.Name,
|
Name: request.Name,
|
||||||
URL: request.Url,
|
URL: strings.TrimSpace(request.Url),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Errorf(codes.Internal, "failed to create webhook, error: %+v", err)
|
return nil, status.Errorf(codes.Internal, "failed to create webhook, error: %+v", err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue