diff --git a/cmd/tclipd/main.go b/cmd/tclipd/main.go index 1163b5d..2fe0533 100644 --- a/cmd/tclipd/main.go +++ b/cmd/tclipd/main.go @@ -126,6 +126,10 @@ LIMIT 5 return } + if jpi.Filename == "" { + jpi.Filename = "untitled" + } + jpis = append(jpis, jpi) } @@ -221,6 +225,10 @@ func (s *Server) TailnetSubmitPaste(w http.ResponseWriter, r *http.Request) { data := r.Form.Get("content") id := uuid.NewString() + if fname == "" { + fname = "untitled" + } + q := ` INSERT INTO pastes ( id @@ -322,6 +330,10 @@ OFFSET ?1 return } + if jpi.Filename == "" { + jpi.Filename = "untitled" + } + jpis = append(jpis, jpi) } @@ -502,6 +514,10 @@ WHERE p.id = ?1` return } + if fname == "" { + fname = "untitled" + } + lang := enry.GetLanguage(fname, []byte(data)) var rawHTML *template.HTML diff --git a/cmd/tclipd/tmpl/publicindex.html b/cmd/tclipd/tmpl/publicindex.html index b547295..b5bb4ea 100644 --- a/cmd/tclipd/tmpl/publicindex.html +++ b/cmd/tclipd/tmpl/publicindex.html @@ -1,6 +1,6 @@ {{template "header" .}}
-

Hello! You have connceted to a private pastebin run by a Tailscale user.

+

Hello! You have connected to a private pastebin run by a Tailscale user.

If this is your tailnet and you are not expecting to see this page, please connect to your tailnet and try your query again.