Revert "fix X-Authlib-Injector-API-Location"
This reverts commit 107bf4da1b09585880deac00fe7c26c76a7c62e0.
This commit is contained in:
parent
107bf4da1b
commit
2fb0bb9d45
@ -5,7 +5,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-chi/chi/v5/middleware"
|
"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 {
|
func APILocationIndication(handle http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
u := &url.URL{}
|
w.Header().Set("X-Authlib-Injector-API-Location", "/api/yggdrasil/")
|
||||||
u.Host = r.Host
|
|
||||||
u.Scheme = r.URL.Scheme
|
|
||||||
u.Path = "/api/yggdrasil/"
|
|
||||||
w.Header().Set("X-Authlib-Injector-API-Location", u.String())
|
|
||||||
handle.ServeHTTP(w, r)
|
handle.ServeHTTP(w, r)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user