Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
class MineHeaderReader
import { MineHeaderReader } from "https://deno.land/x/openbox@1.1.8/runtime/mine_header_reader.ts";

Constructors

new
MineHeaderReader(r: BufReader)

Methods

readMimeHeader(): Promise<Headers | null>

ReadMimeHeader reads a MIME-style header from r. The header is a sequence of possibly continued Key: Value lines ending in a blank line. The returned map m maps CanonicalMIMEHeaderKey(key) to a sequence of values in the same order encountered in the input.

For example, consider this input:

My-Key: Value 1
Long-Key: Even
       Longer Value
My-Key: Value 2

Given that input, ReadMIMEHeader returns the map:

map[string][]string{
	"My-Key": {"Value 1", "Value 2"},
	"Long-Key": {"Even Longer Value"},
}