MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / subURL

Function subURL

internal/panel/handler.go:639–649  ·  view source on GitHub ↗

─── 用户自助门户 API ───────────────────────────────────────────────────────── subURL 根据请求上下文构造完整的订阅链接。

(r *http.Request, token string)

Source from the content-addressed store, hash-verified

637
638// subURL 根据请求上下文构造完整的订阅链接。
639func subURL(r *http.Request, token string) string {
640 scheme := "https"
641 if r.TLS == nil && r.Header.Get("X-Forwarded-Proto") != "https" {
642 scheme = "http"
643 }
644 host := r.Host
645 if fwdHost := r.Header.Get("X-Forwarded-Host"); fwdHost != "" {
646 host = fwdHost
647 }
648 return scheme + "://" + host + "/sub/" + token
649}
650
651
652func (h *Handler) apiResetToken(w http.ResponseWriter, r *http.Request) {

Callers 1

apiResetTokenMethod · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected