Unverified Commit 9f25bb20 authored by ProjectOrangeJuice's avatar ProjectOrangeJuice Committed by GitHub

feat: trim space on webhook url (#4411)

parent 174b8b04
...@@ -3,6 +3,7 @@ package v1 ...@@ -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 ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment