From 2fb0bb9d4566ed5872fdcb4b21c2a146bbea1269 Mon Sep 17 00:00:00 2001 From: xmdhs Date: Fri, 13 Oct 2023 00:51:50 +0800 Subject: [PATCH] Revert "fix X-Authlib-Injector-API-Location" This reverts commit 107bf4da1b09585880deac00fe7c26c76a7c62e0. --- server/route/middleware.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/server/route/middleware.go b/server/route/middleware.go index cf90dca..9a10c33 100644 --- a/server/route/middleware.go +++ b/server/route/middleware.go @@ -5,7 +5,6 @@ import ( "fmt" "log/slog" "net/http" - "net/url" "time" "github.com/go-chi/chi/v5/middleware" @@ -77,11 +76,7 @@ func (l *StructuredLoggerEntry) Panic(v interface{}, stack []byte) { func APILocationIndication(handle http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - u := &url.URL{} - u.Host = r.Host - u.Scheme = r.URL.Scheme - u.Path = "/api/yggdrasil/" - w.Header().Set("X-Authlib-Injector-API-Location", u.String()) + w.Header().Set("X-Authlib-Injector-API-Location", "/api/yggdrasil/") handle.ServeHTTP(w, r) }) }