Compare commits

..

5 commits

Author SHA1 Message Date
Gabriel Simmer 32b733527f
Merge remote-tracking branch 'remotes/origin/main'
All checks were successful
Nix build / build-docker-arm (push) Successful in 9m51s
Nix build / build-docker (push) Successful in 12m43s
2024-03-30 12:59:10 +00:00
Xe Iaso 99fc19f91a
Merge pull request #39 from jolheiser/typo
fix: typo
2023-09-20 14:19:19 -04:00
John Olheiser 3134d24067
fix: typo 2023-09-20 12:55:28 -05:00
Xe Iaso 692e7ac3ca
Merge pull request #37 from tailscale-dev/Xe/no-title-clickable-links
cmd/tclipd: handle untitled pastes better
2023-09-20 11:54:04 -04:00
Xe Iaso 0ecf363607 cmd/tclipd: handle untitled pastes better
Fixes #29

Signed-off-by: Xe Iaso <xe@tailscale.com>
2023-09-20 09:31:57 -04:00
2 changed files with 17 additions and 1 deletions

View file

@ -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

View file

@ -1,6 +1,6 @@
{{template "header" .}}
<div class="prose">
<p>Hello! You have connceted to a private pastebin run by a Tailscale user.</p>
<p>Hello! You have connected to a private pastebin run by a Tailscale user.</p>
<p>If this is your tailnet and you are not expecting to see this page, please connect to your tailnet and try your query again.</p>
</div>