We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8dbe9a commit 6a56646Copy full SHA for 6a56646
src/http/parse_headers.ts
@@ -0,0 +1,13 @@
1
+/**
2
+ * This function parses a Headers object and returns it as a parsed object.
3
+ *
4
+ * @param headers Header that should get parsed
5
+ * @returns The parsed header
6
+ */
7
+export default function parseHeaders(headers : Headers) : Record<string, string> {
8
+ const header : Record<string, string> = {};
9
+ for(const [key, value] of headers.entries()) {
10
+ header[key] = value;
11
+ };
12
+ return header;
13
+}
0 commit comments