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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user