forked from electricdusk/rushlink
Update metadata info view
This commit is contained in:
@@ -1,3 +1,36 @@
|
||||
{{define "title"}}
|
||||
'{{.Paste.Key}}' meta info - rushlink
|
||||
'{{.Paste.Key}}{{.FileExt}}' metadata - rushlink
|
||||
{{end}}
|
||||
|
||||
{{define "body"}}
|
||||
<pre>
|
||||
<a href="{{.Host}}/{{.Paste.Key}}{{.FileExt}}">{{.Host}}/{{.Paste.Key}}{{.FileExt}}</a>
|
||||
---
|
||||
{{if and (ne .Paste.State.String "deleted") .CanDelete.Bool}}
|
||||
with delete token: <a href="{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Request.URL.Query.Get "deleteToken"}}">{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Request.URL.Query.Get "deleteToken"}}</a>
|
||||
{{else -}}
|
||||
with delete token: <unknown>
|
||||
{{end -}}
|
||||
type: {{.Paste.Type}}
|
||||
state: {{.Paste.State}}
|
||||
{{if .Paste.TimeCreated.IsZero -}}
|
||||
created: unknown
|
||||
{{else -}}
|
||||
created: {{.Paste.TimeCreated}}
|
||||
{{end -}}
|
||||
delete token: {{.CanDelete.String}}
|
||||
|
||||
{{if and (ne .Paste.State.String "deleted") .CanDelete.Bool}}
|
||||
```
|
||||
# To delete this {{.Paste.Type}}, execute:
|
||||
{{- /*
|
||||
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" "<a href="{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Request.URL.Query.Get "deleteToken"}}">{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Request.URL.Query.Get "deleteToken"}}"</a>
|
||||
```
|
||||
</pre>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -1,17 +1,27 @@
|
||||
METADATA on <{{.Host}}/{{.Paste.Key}}>:
|
||||
|
||||
TYPE: {{.Paste.Type}}
|
||||
STATE: {{.Paste.State}}
|
||||
{{if .Paste.TimeCreated.IsZero -}}
|
||||
CREATED: undefined
|
||||
{{.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 -}}
|
||||
CREATED: {{.Paste.TimeCreated}}
|
||||
with delete token: <unknown>
|
||||
{{end -}}type: {{.Paste.Type}}
|
||||
state: {{.Paste.State}}
|
||||
{{if .Paste.TimeCreated.IsZero -}}
|
||||
created: unknown
|
||||
{{else -}}
|
||||
created: {{.Paste.TimeCreated}}
|
||||
{{end -}}
|
||||
DELETE TOKEN: {{.CanDelete.String}}
|
||||
delete token: {{.CanDelete.String}}
|
||||
|
||||
{{if and (ne .Paste.State.String "deleted") .CanDelete.Bool}}
|
||||
```
|
||||
# To delete this {{.Paste.Type}}, execute:
|
||||
curl --request "DELETE" "{{.Host}}/{{.Paste.Key}}?deleteToken={{.Request.URL.Query.Get "deleteToken"}}"
|
||||
{{- /*
|
||||
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"}}"
|
||||
```
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user