1
0
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:
Neo 2018-12-18 02:03:23 +00:00
parent 9accd685c0
commit 55c07c6f87

View File

@ -405,14 +405,16 @@ func (s *Site) handlePageRequest(c *gin.Context) {
// Destroy page if it is opened and primed
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.Erase()
if p.IsPublished {
command = "/read"
} else {
command = "/view"
}
}
p.Erase()
}
if command == "/erase" {
if !isLocked && !p.IsEncrypted {
p.Erase()