Skip to content

Commit c2b9c13

Browse files
committed
fix public URL creation
1 parent d0464de commit c2b9c13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/server/impl/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"bytes"
55
"context"
66
"fmt"
7-
"path"
87
"path/filepath"
8+
"strings"
99

1010
"github.com/reddec/api-notes/internal/render"
1111
"github.com/reddec/api-notes/internal/server/api"
@@ -28,7 +28,7 @@ func (srv *Server) CreateNote(ctx context.Context, req *api.DraftMultipart) (*ap
2828
}
2929
return &api.Note{
3030
ID: api.ID(id),
31-
PublicURL: path.Join(srv.BaseURL, pid),
31+
PublicURL: strings.TrimRight(srv.BaseURL, "/") + "/" + pid,
3232
}, nil
3333
}
3434

0 commit comments

Comments
 (0)