2019-12-16 05:49:17 +01:00
|
|
|
{{.Host}}/{{.Paste.Key}}{{.FileExt}}
|
|
|
|
---
|
|
|
|
{{if and (ne .Paste.State.String "deleted") .CanDelete.Bool}}
|
|
|
|
with delete token: {{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Request.URL.Query.Get "deleteToken"}}
|
|
|
|
{{else -}}
|
|
|
|
with delete token: <unknown>
|
|
|
|
{{end -}}type: {{.Paste.Type}}
|
|
|
|
state: {{.Paste.State}}
|
2019-09-21 13:11:38 +02:00
|
|
|
{{if .Paste.TimeCreated.IsZero -}}
|
2019-12-16 05:49:17 +01:00
|
|
|
created: unknown
|
2019-09-21 13:11:38 +02:00
|
|
|
{{else -}}
|
2019-12-16 05:49:17 +01:00
|
|
|
created: {{.Paste.TimeCreated}}
|
2019-09-21 13:11:38 +02:00
|
|
|
{{end -}}
|
2019-12-16 05:49:17 +01:00
|
|
|
delete token: {{.CanDelete.String}}
|
2019-09-21 13:11:38 +02:00
|
|
|
|
|
|
|
{{if and (ne .Paste.State.String "deleted") .CanDelete.Bool}}
|
|
|
|
```
|
|
|
|
# To delete this {{.Paste.Type}}, execute:
|
2019-12-16 05:49:17 +01:00
|
|
|
{{- /*
|
|
|
|
We have the option here to take the deleteToken from the user request or
|
|
|
|
from .Paste. Both are equivalent as long as .CanDelete is correct. We
|
|
|
|
use the .Request value, because leaking the deleteToken would be a more
|
|
|
|
dramatic vulnerability.
|
|
|
|
*/ -}}
|
|
|
|
curl --request "DELETE" "{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Request.URL.Query.Get "deleteToken"}}"
|
2019-09-21 13:11:38 +02:00
|
|
|
```
|
|
|
|
{{end}}
|