MCPcopy Index your code
hub / github.com/ZenNotes/zennotes / isLoopbackOrigin

Function isLoopbackOrigin

apps/server/internal/httpserver/security.go:289–300  ·  view source on GitHub ↗
(origin string)

Source from the content-addressed store, hash-verified

287}
288
289func isLoopbackOrigin(origin string) bool {
290 parsed, err := url.Parse(origin)
291 if err != nil {
292 return false
293 }
294 host := parsed.Hostname()
295 if strings.EqualFold(host, "localhost") {
296 return true
297 }
298 ip := net.ParseIP(host)
299 return ip != nil && ip.IsLoopback()
300}
301
302func (s *Server) isAllowedOrigin(r *http.Request, origin string) bool {
303 if origin == "" {

Callers 1

isAllowedOriginMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected