_ lists
This commit is contained in:
@@ -201,7 +201,22 @@ func pushMeta(r *http.Request, k, v string) {
|
||||
}
|
||||
|
||||
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
s.Pre(s.Proxy)(w, r)
|
||||
foo := s.Proxy
|
||||
if strings.Split(r.Host, ".")[0] == "_" {
|
||||
keys := s.db.Keys(nsRouting)
|
||||
hostURL := map[string]string{}
|
||||
for _, key := range keys {
|
||||
u, _ := s.lookup(key)
|
||||
if u != nil {
|
||||
hostURL[key] = u.String()
|
||||
}
|
||||
}
|
||||
json.NewEncoder(w).Encode(map[string]any{
|
||||
"hostsToURLs": hostURL,
|
||||
})
|
||||
return
|
||||
}
|
||||
s.Pre(foo)(w, r)
|
||||
}
|
||||
|
||||
type corsResponseWriter struct {
|
||||
|
||||
Reference in New Issue
Block a user