forked from electricdusk/rushlink
Show meta page immediately after create
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
<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>
|
||||
{{if and (ne .Paste.State.String "deleted") .CanDeleteBool}}
|
||||
with delete token: <a href="{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Paste.DeleteToken}}">{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Paste.DeleteToken}}</a>
|
||||
{{else -}}
|
||||
with delete token: <unknown>
|
||||
{{end -}}
|
||||
@@ -18,18 +18,11 @@ created: unknown
|
||||
{{else -}}
|
||||
created: {{.Paste.TimeCreated}}
|
||||
{{end -}}
|
||||
delete token: {{.CanDelete.String}}
|
||||
delete token: {{.CanDelete}}
|
||||
|
||||
{{if and (ne .Paste.State.String "deleted") .CanDelete.Bool}}
|
||||
{{if and (ne .Paste.State.String "deleted") .CanDeleteBool}}
|
||||
```
|
||||
# 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>
|
||||
curl --request "DELETE" "<a href="{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Paste.DeleteToken}}">{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Paste.DeleteToken}}"</a>
|
||||
```
|
||||
</pre>
|
||||
{{end}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{.Host}}/{{.Paste.Key}}{{.FileExt}}
|
||||
---
|
||||
{{if and (ne .Paste.State.String "deleted") .CanDelete.Bool}}
|
||||
{{if and (ne .Paste.State.String "deleted") .CanDeleteBool}}
|
||||
with delete token: {{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Request.URL.Query.Get "deleteToken"}}
|
||||
{{else -}}
|
||||
with delete token: <unknown>
|
||||
@@ -11,17 +11,11 @@ created: unknown
|
||||
{{else -}}
|
||||
created: {{.Paste.TimeCreated}}
|
||||
{{end -}}
|
||||
delete token: {{.CanDelete.String}}
|
||||
delete token: {{.CanDelete}}
|
||||
|
||||
{{if and (ne .Paste.State.String "deleted") .CanDelete.Bool}}
|
||||
{{if and (ne .Paste.State.String "deleted") .CanDeleteBool}}
|
||||
```
|
||||
# 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" "{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Request.URL.Query.Get "deleteToken"}}"
|
||||
curl --request "DELETE" "{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Paste.DeleteToken}}"
|
||||
```
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user