fix: replace crypto/md5 with crypto/sha256 for IP hashing
This commit is contained in:
@@ -2,7 +2,7 @@ package bookings
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/md5"
|
||||
"crypto/sha256"
|
||||
"crussell/clock"
|
||||
"crussell/db"
|
||||
"crussell/handlers/scheduling"
|
||||
@@ -152,7 +152,7 @@ func AdminReserveSlotHandler(w http.ResponseWriter, r *http.Request) {
|
||||
ip = r.RemoteAddr
|
||||
}
|
||||
}
|
||||
ipHash := fmt.Sprintf("%x", md5.Sum([]byte(ip)))[:8]
|
||||
ipHash := fmt.Sprintf("%x", sha256.Sum256([]byte(ip)))[:8]
|
||||
if _, delErr := db.Conn.Exec(r.Context(), `
|
||||
DELETE FROM time_blockers
|
||||
WHERE (description LIKE 'RESERVATION:admin:%' AND created_by = $1)
|
||||
|
||||
Reference in New Issue
Block a user