Documentation
¶
Overview ¶
Package httplines normalizes HTTP header input from APIs and MCP tools. Agents often pass headers as a JSON object; humans use "Key: Value" lines.
Index ¶
- func NormalizeArg(v any) (map[string][]string, error)
- func NormalizeCRLF(s string) string
- func NormalizeJSON(raw json.RawMessage) (map[string][]string, error)
- func ParseRawRequest(raw string) (method, path string, headers map[string][]string, body []byte, err error)
- func ToLines(h map[string][]string) string
- func ToMap(s string) map[string][]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeArg ¶
NormalizeArg is the MCP/API helper: string lines, JSON object map, or empty.
func NormalizeCRLF ¶
NormalizeCRLF converts LF-only newlines to CRLF (Burp-style raw editor).
func NormalizeJSON ¶
func NormalizeJSON(raw json.RawMessage) (map[string][]string, error)
NormalizeJSON accepts JSON null, a "Key: Value\n…" string, or a {"Key":"Value"} object.
func ParseRawRequest ¶
func ParseRawRequest(raw string) (method, path string, headers map[string][]string, body []byte, err error)
ParseRawRequest parses a raw HTTP request (request line + headers + body after a blank line). Content-Length is dropped — callers recompute it from the body.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.