mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: trim space on webhook url (#4411)
This commit is contained in:
committed by
GitHub
parent
174b8b048a
commit
9f25bb2034
@@ -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)
|
||||
|
Reference in New Issue
Block a user