mirror of https://github.com/bjdgyc/anylink.git
添加codecov配置文件
This commit is contained in:
parent
edb0fe2dc9
commit
665732fc03
|
@ -0,0 +1,4 @@
|
|||
ignore:
|
||||
- "conf"
|
||||
- "down_files"
|
||||
- "screenshot"
|
|
@ -27,7 +27,9 @@ jobs:
|
|||
go get -v -t -d ./...
|
||||
|
||||
- name: Build
|
||||
run: go build -v .
|
||||
run: |
|
||||
go build -v -o anylink -ldflags "-X main.COMMIT_ID=`git rev-parse HEAD`"
|
||||
./anylink -rev
|
||||
|
||||
- name: Test coverage
|
||||
run: go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
|
||||
|
|
|
@ -17,10 +17,10 @@ import (
|
|||
func LinkAuth(w http.ResponseWriter, r *http.Request) {
|
||||
// 判断anyconnect客户端
|
||||
userAgent := strings.ToLower(r.UserAgent())
|
||||
x_Aggregate_Auth := r.Header.Get("X-Aggregate-Auth")
|
||||
x_Transcend_Version := r.Header.Get("X-Transcend-Version")
|
||||
xAggregateAuth := r.Header.Get("X-Aggregate-Auth")
|
||||
xTranscendVersion := r.Header.Get("X-Transcend-Version")
|
||||
if !(strings.Contains(userAgent, "anyconnect") &&
|
||||
x_Aggregate_Auth == "1" && x_Transcend_Version == "1") {
|
||||
xAggregateAuth == "1" && xTranscendVersion == "1") {
|
||||
w.WriteHeader(http.StatusForbidden)
|
||||
fmt.Fprintf(w, "error request")
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue