mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-05-31 04:37:20 +02:00

- Updated plugin interface to support static path routing - Added autosave for statistic data (workaround for #561)
27 lines
562 B
Go
27 lines
562 B
Go
package main
|
|
|
|
import (
|
|
_ "embed"
|
|
"fmt"
|
|
"net/http"
|
|
"sort"
|
|
)
|
|
|
|
// Render the debug UI
|
|
func RenderDebugUI(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Fprint(w, "**static_capture Debug Interface**\n\n[Recv Headers] \n")
|
|
|
|
headerKeys := make([]string, 0, len(r.Header))
|
|
for name := range r.Header {
|
|
headerKeys = append(headerKeys, name)
|
|
}
|
|
sort.Strings(headerKeys)
|
|
for _, name := range headerKeys {
|
|
values := r.Header[name]
|
|
for _, value := range values {
|
|
fmt.Fprintf(w, "%s: %s\n", name, value)
|
|
}
|
|
}
|
|
w.Header().Set("Content-Type", "text/html")
|
|
}
|