INNER CODE UNIT · Go

func

orneryd/NornicDB · cmd/eval/main.go:51

func (s *safeClient) Get(rawURL string) (*http.Response, error) {
	if err := validateURL(rawURL); err != nil {
		return nil, fmt.Errorf("SSRF protection: %w", err)
	}
	return s.client.Get(rawURL)
}

// Post performs a POST request after validating the URL is localhost-only.
func (s *safeClient) Post(rawURL, contentType string, body io.Reader) (*http.Response, error) {
	if err := validateURL(rawURL); err != nil {
		return nil, fmt.Errorf("SSRF protection: %w", err)
	}
	return s.client.Post(rawURL, contentType, body)
}

func main() {
	// Parse flags
	serverURL := flag.String("url", "http://localhost:7474", "NornicDB server URL")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…