fixing vote IP checks
This commit is contained in:
parent
be42fa1043
commit
d51712f8e7
@ -121,7 +121,6 @@ func AddPost(c *fiber.Ctx) error{
|
||||
}
|
||||
|
||||
post.Date = time.Now().Format("02/01/06")
|
||||
log.Println(post.Date)
|
||||
post.ID = TitleToID(post.Title)
|
||||
|
||||
_, err := DB.Exec(
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"database/sql"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/ngn13/website/api/util"
|
||||
@ -29,7 +30,7 @@ func BlogDb(db *sql.DB) {
|
||||
|
||||
func GetIP(c *fiber.Ctx) string {
|
||||
if c.Get("X-Real-IP") != "" {
|
||||
return c.Get("X-Real-IP")
|
||||
return strings.Clone(c.Get("X-Real-IP"))
|
||||
}
|
||||
|
||||
return c.IP()
|
||||
|
Loading…
x
Reference in New Issue
Block a user