mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
FIXES: 142 Make /raw work with self-destructing pages
This commit is contained in:
@ -405,14 +405,16 @@ func (s *Site) handlePageRequest(c *gin.Context) {
|
|||||||
|
|
||||||
// Destroy page if it is opened and primed
|
// Destroy page if it is opened and primed
|
||||||
if p.IsPrimedForSelfDestruct && !isLocked && !p.IsEncrypted {
|
if p.IsPrimedForSelfDestruct && !isLocked && !p.IsEncrypted {
|
||||||
|
if command != "/raw" {
|
||||||
p.Update("<center><em>This page has self-destructed. You cannot return to it.</em></center>\n\n" + p.Text.GetCurrent())
|
p.Update("<center><em>This page has self-destructed. You cannot return to it.</em></center>\n\n" + p.Text.GetCurrent())
|
||||||
p.Erase()
|
|
||||||
if p.IsPublished {
|
if p.IsPublished {
|
||||||
command = "/read"
|
command = "/read"
|
||||||
} else {
|
} else {
|
||||||
command = "/view"
|
command = "/view"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
p.Erase()
|
||||||
|
}
|
||||||
if command == "/erase" {
|
if command == "/erase" {
|
||||||
if !isLocked && !p.IsEncrypted {
|
if !isLocked && !p.IsEncrypted {
|
||||||
p.Erase()
|
p.Erase()
|
||||||
|
Reference in New Issue
Block a user