From b39d4a0ea81973e2eab1f2569c13d6694d242887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=B9=BF?= Date: Mon, 25 Dec 2023 13:34:29 +0800 Subject: [PATCH] remove change to static file --- config.json | 2 +- server/directive.go | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/config.json b/config.json index 4aa87b2..7ee5f70 100644 --- a/config.json +++ b/config.json @@ -45,7 +45,7 @@ "paths":[ { "path": "/", - "upstreams": ["http://localhost:4200"], + "upstreams": ["http://192.168.12.174:9880"], "directives":["HostSchemas $target"] }, { diff --git a/server/directive.go b/server/directive.go index 8c659a1..ace6f8f 100644 --- a/server/directive.go +++ b/server/directive.go @@ -3,7 +3,6 @@ package server import ( "fmt" "net/http" - "path/filepath" "strings" "git.pyer.club/kingecg/gologger" @@ -37,12 +36,12 @@ var Gzip_Response Directive = func(args ...string) Middleware { return func(w http.ResponseWriter, r *http.Request, next func()) { l := gologger.GetLogger("Directive") l.Debug("Gzip-Response") - if filepath.Ext(r.URL.Path) != "" { - ctx := r.Context() - m := ctx.Value(RequestCtxKey("data")).(map[string]interface{}) - m["Tg"] = "gzip" + // if filepath.Ext(r.URL.Path) != "" { + ctx := r.Context() + m := ctx.Value(RequestCtxKey("data")).(map[string]interface{}) + m["Tg"] = "gzip" - } + // } next() }