feat(http/unstable): headers module (#4317)

* Added IANA headers

* Apply suggestions from code review

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>

* Cleaned up and added jsr support

* Fixed linting

* unstable notices

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
Halvard Mørstad 2024-08-06 11:29:53 +02:00 committed by GitHub
parent a9f3558b85
commit 259ce6dfd2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 1224 additions and 0 deletions

View File

@ -6,6 +6,7 @@
"./cookie": "./cookie.ts",
"./etag": "./etag.ts",
"./file-server": "./file_server.ts",
"./header": "./header.ts",
"./method": "./method.ts",
"./negotiation": "./negotiation.ts",
"./server-sent-event-stream": "./server_sent_event_stream.ts",

1206
http/header.ts Normal file

File diff suppressed because it is too large Load Diff

16
http/header_test.ts Normal file
View File

@ -0,0 +1,16 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { HEADER } from "./header.ts";
import { assertEquals } from "@std/assert";
Deno.test({
name: "HEADER",
fn() {
// just spot check a few common codes
assertEquals(HEADER.Accept, "Accept");
assertEquals(HEADER.AIm, "A-IM");
assertEquals(HEADER.ClientCertChain, "Client-Cert-Chain");
assertEquals(HEADER.Connection, "Connection");
assertEquals(HEADER.Origin, "Origin");
assertEquals(HEADER.Referer, "Referer");
},
});

View File

@ -69,4 +69,5 @@ export * from "./signed_cookie.ts";
export * from "./server_sent_event_stream.ts";
export * from "./user_agent.ts";
export * from "./file_server.ts";
export * from "./header.ts";
export * from "./method.ts";