refactor: consolidate debug flag and update gitignore

- Rename debugMode to isDebug for consistency across codebase
- Move debug flag check in ValidateTimeStamp to match other validations
- Add database.db to gitignore and remove unused config file
- Update README.md to clarify user registration rules
This commit is contained in:
2026-02-28 15:48:01 +08:00
parent ff62e3e755
commit b46f6dbfc2
8 changed files with 32 additions and 27 deletions
+4 -4
View File
@@ -178,6 +178,10 @@ func isValidPassword(password string) bool { // Validate password complexity and
}
func ValidateTimeStamp(header http.Header) bool {
if isDebug {
return true
}
timeStampStr := header.Get("X-Timestamp")
if timeStampStr == "" {
return false
@@ -188,10 +192,6 @@ func ValidateTimeStamp(header http.Header) bool {
return false
}
if globalConfig.Debug {
return true
}
currentTime := time.Now().UnixMilli()
if currentTime-timeStamp > 3000 || timeStamp-currentTime > 3000 {
return false