1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Don't need this password checking now

This commit is contained in:
Zack Scholl 2016-03-28 19:29:30 -04:00
parent 7250ebc0a2
commit 600dd685f1
2 changed files with 25 additions and 36 deletions

View File

@ -109,10 +109,6 @@ Options:`)
r.GET("/:title", editNote) r.GET("/:title", editNote)
r.PUT("/:title", func(c *gin.Context) { r.PUT("/:title", func(c *gin.Context) {
filename := c.Param("title") filename := c.Param("title")
fmt.Println(filename)
fmt.Println(c.Request.Body)
fmt.Println(c.Request.ContentLength)
fmt.Println(c.Request.Header)
contentLength := c.Request.ContentLength contentLength := c.Request.ContentLength
var reader io.Reader var reader io.Reader
reader = c.Request.Body reader = c.Request.Body
@ -154,10 +150,9 @@ Options:`)
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
buf.ReadFrom(reader) buf.ReadFrom(reader)
fmt.Println("---------------") fmt.Println("---------------")
fmt.Println(buf.String()) fmt.Println(filename)
fmt.Println("---------------") fmt.Println("---------------")
fmt.Println(c.ContentType()) fmt.Println(buf.String())
fmt.Println(c.Request.Header)
fmt.Println("---------------") fmt.Println("---------------")
p := WikiData{filename, "", []string{}, []string{}, false, ""} p := WikiData{filename, "", []string{}, []string{}, false, ""}
p.save(buf.String()) p.save(buf.String())

View File

@ -157,10 +157,6 @@ func editNote(c *gin.Context) {
c.Data(200, "text/plain", robotsTxtFile) c.Data(200, "text/plain", robotsTxtFile)
} else if strings.ToLower(title) == "help" { //}&& strings.Contains(AllowedIPs, c.ClientIP()) != true { } else if strings.ToLower(title) == "help" { //}&& strings.Contains(AllowedIPs, c.ClientIP()) != true {
c.Redirect(302, "/Help/view") c.Redirect(302, "/Help/view")
} else {
locked, _ := hasPassword(title)
if locked {
c.Redirect(302, "/"+title+"/view")
} else { } else {
version := c.DefaultQuery("version", "-1") version := c.DefaultQuery("version", "-1")
versionNum, _ := strconv.Atoi(version) versionNum, _ := strconv.Atoi(version)
@ -187,8 +183,6 @@ func editNote(c *gin.Context) {
"SocketType": RuntimeArgs.Socket, "SocketType": RuntimeArgs.Socket,
"NoEdit": !currentVersion, "NoEdit": !currentVersion,
}) })
}
} }
} }