From e00d1cb1222bfa38e360f13d61d46047a442ac48 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Wed, 13 Dec 2017 22:00:17 +0100 Subject: [PATCH] Fixed shareX uploading issue, when the filename contains space that an error was thrown --- store/store.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/store/store.go b/store/store.go index d379b42..4c61169 100644 --- a/store/store.go +++ b/store/store.go @@ -7,6 +7,7 @@ import ( "crypto/sha512" "encoding/json" "path/filepath" + "strings" "time" "github.com/maxibanki/golang-url-shortener/util" @@ -149,6 +150,7 @@ func (s *Store) GetEntryByIDRaw(id string) ([]byte, error) { // CreateEntry creates a new record and returns his short id func (s *Store) CreateEntry(entry Entry, givenID, password string) (string, []byte, error) { + entry.Public.URL = strings.Replace(entry.Public.URL, " ", "%20", -1) if !govalidator.IsURL(entry.Public.URL) { return "", nil, ErrNoValidURL }