fix: 移除CheckExtValidRequest检查旧token

This commit is contained in:
TsMask
2024-04-01 16:53:20 +08:00
parent 96ee5837c4
commit bdd04105fe
3 changed files with 52 additions and 54 deletions

View File

@@ -186,11 +186,11 @@ func PostMML2ToNF(w http.ResponseWriter, r *http.Request) {
func PostMMLToNF(w http.ResponseWriter, r *http.Request) {
log.Debug("PostMMLToNF processing... ")
token, err := services.CheckExtValidRequest(w, r)
if err != nil {
log.Error("Request error:", err)
return
}
// token, err := services.CheckExtValidRequest(w, r)
// if err != nil {
// log.Error("Request error:", err)
// return
// }
// 经过测试linux下延时需要大于100ms
// var TIME_DELAY_AFTER_WRITE time.Duration = 200
// var TIME_DEAD_LINE time.Duration = 10
@@ -214,8 +214,7 @@ func PostMMLToNF(w http.ResponseWriter, r *http.Request) {
}
log.Debug("neType:", neType, "neId", neId)
log.Debugf("token:%s, method:%s, managementType:%s dbname:%s, tbname:%s pack:%s",
token, r.Method, module, neType, neId[0], pack)
log.Debugf("method:%s, managementType:%s dbname:%s, tbname:%s pack:%s", r.Method, module, neType, neId[0], pack)
var buf [20 * 1024]byte
//buf := make([]byte, 0)
@@ -250,7 +249,7 @@ func PostMMLToNF(w http.ResponseWriter, r *http.Request) {
}
neInfo := new(dborm.NeInfo)
neInfo, err = dborm.XormGetNeInfo(neType, neId[0])
neInfo, err := dborm.XormGetNeInfo(neType, neId[0])
if err != nil {
log.Error("dborm.XormGetNeInfo is failed:", err)
services.ResponseInternalServerError500DatabaseOperationFailed(w)
@@ -631,11 +630,11 @@ func PostMMLToNF(w http.ResponseWriter, r *http.Request) {
func PostMMLToOMC(w http.ResponseWriter, r *http.Request) {
log.Debug("PostMMLToOMC processing... ")
token, err := services.CheckExtValidRequest(w, r)
if err != nil {
log.Error("Failed to CheckMmlValidRequest:", err)
return
}
// token, err := services.CheckExtValidRequest(w, r)
// if err != nil {
// log.Error("Failed to CheckMmlValidRequest:", err)
// return
// }
params := r.URL.Query()
neId := params["ne_id"]
@@ -646,7 +645,7 @@ func PostMMLToOMC(w http.ResponseWriter, r *http.Request) {
}
neInfo := new(dborm.NeInfo)
neInfo, err = dborm.XormGetNeInfo("OMC", neId[0])
neInfo, err := dborm.XormGetNeInfo("OMC", neId[0])
if err != nil {
log.Error("dborm.XormGetNeInfo is failed:", err)
services.ResponseInternalServerError500DatabaseOperationFailed(w)
@@ -670,7 +669,7 @@ func PostMMLToOMC(w http.ResponseWriter, r *http.Request) {
MmlHome: config.GetYamlConfig().MML.MmlHome,
Limit: 50,
User: "",
SessionToken: token, // 旧token
SessionToken: "", // 旧token
Authorization: r.Header.Get(tokenConst.HEADER_KEY), // 请求Token
HttpUri: hostUri,
UserAgent: config.GetDefaultUserAgent(),