mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 16:43:25 +08:00
修改profile文件
This commit is contained in:
@@ -19,7 +19,7 @@ func LinkAuth(w http.ResponseWriter, r *http.Request) {
|
||||
userAgent := strings.ToLower(r.UserAgent())
|
||||
xAggregateAuth := r.Header.Get("X-Aggregate-Auth")
|
||||
xTranscendVersion := r.Header.Get("X-Transcend-Version")
|
||||
if !((strings.Contains(userAgent, "anyconnect") || strings.Contains(userAgent, "openconnect")) &&
|
||||
if !((strings.Contains(userAgent, "anyconnect") || strings.Contains(userAgent, "openconnect")) &&
|
||||
xAggregateAuth == "1" && xTranscendVersion == "1") {
|
||||
w.WriteHeader(http.StatusForbidden)
|
||||
fmt.Fprintf(w, "error request")
|
||||
@@ -176,7 +176,7 @@ var auth_complete = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<vpn-profile-manifest>
|
||||
<vpn rev="1.0">
|
||||
<file type="profile" service-type="user">
|
||||
<uri>/profile.xml</uri>
|
||||
<uri>/files/profile.xml</uri>
|
||||
<hash type="sha1">A8B0B07FBA93D06E8501E40AB807AEE2464E73B7</hash>
|
||||
</file>
|
||||
</vpn>
|
||||
|
@@ -77,9 +77,9 @@ func initRoute() http.Handler {
|
||||
r.HandleFunc("/", LinkAuth).Methods(http.MethodPost)
|
||||
r.HandleFunc("/CSCOSSLC/tunnel", LinkTunnel).Methods(http.MethodConnect)
|
||||
r.HandleFunc("/otp_qr", LinkOtpQr).Methods(http.MethodGet)
|
||||
r.HandleFunc("/profile.xml", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte(auth_profile))
|
||||
}).Methods(http.MethodGet)
|
||||
// r.HandleFunc("/profile.xml", func(w http.ResponseWriter, r *http.Request) {
|
||||
// w.Write([]byte(auth_profile))
|
||||
// }).Methods(http.MethodGet)
|
||||
r.PathPrefix("/files/").Handler(
|
||||
http.StripPrefix("/files/",
|
||||
http.FileServer(http.Dir(base.Cfg.FilesPath)),
|
||||
|
Reference in New Issue
Block a user