mirror of
https://github.com/Rayzggz/server_torii.git
synced 2025-06-23 23:41:30 +08:00
revert: Let Current Waiting room become External Migration
This commit is contained in:
@ -25,7 +25,7 @@ func CheckMain(w http.ResponseWriter, userRequestData dataType.UserRequest, rule
|
||||
checkFuncs = append(checkFuncs, check.URLBlockList)
|
||||
checkFuncs = append(checkFuncs, check.VerifyBot)
|
||||
checkFuncs = append(checkFuncs, check.HTTPFlood)
|
||||
checkFuncs = append(checkFuncs, check.WaitingRoom)
|
||||
checkFuncs = append(checkFuncs, check.ExternalMigration)
|
||||
checkFuncs = append(checkFuncs, check.Captcha)
|
||||
|
||||
for _, checkFunc := range checkFuncs {
|
||||
@ -107,35 +107,6 @@ func CheckMain(w http.ResponseWriter, userRequestData dataType.UserRequest, rule
|
||||
return
|
||||
}
|
||||
|
||||
} else if bytes.Compare(decision.HTTPCode, []byte("WAITING_ROOM")) == 0 {
|
||||
tpl, err := template.ParseFiles(cfg.ErrorPage + "/waiting_room.html")
|
||||
if err != nil {
|
||||
utils.LogError(userRequestData, fmt.Sprintf("Error parsing template: %v", err), "CheckMain")
|
||||
http.Error(w, "500 - Internal Server Error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
sessionID := string(decision.ResponseData)
|
||||
|
||||
data := struct {
|
||||
EdgeTag string
|
||||
ConnectIP string
|
||||
Date string
|
||||
}{
|
||||
EdgeTag: cfg.NodeName,
|
||||
ConnectIP: userRequestData.RemoteIP,
|
||||
Date: time.Now().Format("2006-01-02 15:04:05"),
|
||||
}
|
||||
|
||||
w.Header().Set("Set-Cookie", "__torii_session_id="+sessionID+"; Path=/; Max-Age=86400; Priority=High; HttpOnly;")
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
if err = tpl.Execute(w, data); err != nil {
|
||||
utils.LogError(userRequestData, fmt.Sprintf("Error executing template: %v", err), "CheckMain")
|
||||
http.Error(w, "500 - Internal Server Error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
} else {
|
||||
//should never happen
|
||||
utils.LogError(userRequestData, fmt.Sprintf("Error access in wrong state: %v", decision), "CheckMain")
|
||||
|
Reference in New Issue
Block a user