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

Method handleDetectGoogle

internal/ipsentinel/nodehandler.go:166–177  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

164}
165
166func (h *NodeHandler) handleDetectGoogle(w http.ResponseWriter, r *http.Request) {
167 cfg, err := h.loadConfig()
168 if err != nil {
169 cfg = Config{ValidURLSuffix: "com"}
170 }
171 result, err := DetectGoogle(r.Context(), cfg)
172 if err != nil {
173 writeNodeJSON(w, http.StatusInternalServerError, map[string]any{"error": err.Error()})
174 return
175 }
176 writeNodeJSON(w, http.StatusOK, result)
177}
178
179func (h *NodeHandler) handleRun(w http.ResponseWriter, r *http.Request) {
180 var body struct {

Callers

nothing calls this directly

Calls 4

loadConfigMethod · 0.95
DetectGoogleFunction · 0.85
writeNodeJSONFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected