Documentation
¶
Overview ¶
Copyright 2025 The Go MCP SDK Authors. All rights reserved. Use of this source code is governed by the license that can be found in the LICENSE file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLoopback ¶ added in v1.4.0
func IsPrivateOrReserved ¶ added in v1.8.0
IsPrivateOrReserved reports whether ip belongs to a range that must not be reachable through a server-controlled URL, as a defense against SSRF: private (RFC 1918 / RFC 4193 ULA), link-local (including the 169.254.169.254 cloud metadata endpoint), carrier-grade NAT, multicast, and the unspecified address.
func RestrictRedirects ¶
RestrictRedirects returns a copy of c, or of http.DefaultClient if c is nil, that stops after 10 requests, as net/http does by default, and follows only redirects that stay within the origin of the request they redirect and keep the method of the original request. Otherwise a server could reroute a request, with its headers and body, to another origin, or turn a POST into a bodyless GET. An upgrade from http to https on the same host, with default ports, stays within the origin.
It returns c (or http.DefaultClient) unchanged if c sets its own CheckRedirect, which then decides alone, or if the followallredirects MCPGODEBUG option is set.
Types ¶
This section is empty.