diff --git a/src/http/parse_headers.ts b/src/http/parse_headers.ts new file mode 100644 index 0000000..2a08788 --- /dev/null +++ b/src/http/parse_headers.ts @@ -0,0 +1,13 @@ +/** + * This function parses a Headers object and returns it as a parsed object. + * + * @param headers Header that should get parsed + * @returns The parsed header + */ +export default function parseHeaders(headers : Headers) : Record { + const header : Record = {}; + for(const [key, value] of headers.entries()) { + header[key] = value; + }; + return header; +}