api_key验证方式
This commit is contained in:
parent
fbdd8c2ff2
commit
18e919113f
@ -1,7 +1,6 @@
|
|||||||
package agent
|
package agent
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -21,7 +20,6 @@ func (a *keyChecker) check(c *client, r *http.Request) bool {
|
|||||||
apikey = r.RequestURI[i+len("api_key="):]
|
apikey = r.RequestURI[i+len("api_key="):]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Printf("apikey = %s\n", apikey)
|
|
||||||
if len(apikey) > 0 && strings.HasPrefix(apikey, "simpletest2025_") {
|
if len(apikey) > 0 && strings.HasPrefix(apikey, "simpletest2025_") {
|
||||||
c.setApiKey(apikey)
|
c.setApiKey(apikey)
|
||||||
return true
|
return true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user