feat: set peerDependencies

This commit is contained in:
2025-07-07 13:04:31 +02:00
parent 4a97f4d4c6
commit 3c244998f7
14 changed files with 145 additions and 93 deletions

View File

@@ -2,7 +2,10 @@ import { NEW_LINE, PROTOCOL } from "./common.ts";
import { Response } from "./response.ts";
export class Request {
constructor(readonly connection: Deno.Conn, readonly options: RequestOptions) {}
constructor(
readonly connection: Deno.Conn,
readonly options: RequestOptions,
) {}
async send(): Promise<Response> {
const http = await this.encode(this.toHttp());
@@ -12,9 +15,7 @@ export class Request {
toHttp() {
const { method, path, headers = {}, body } = this.options;
const parts: string[] = [
`${method} ${path} ${PROTOCOL}`,
];
const parts: string[] = [`${method} ${path} ${PROTOCOL}`];
for (const key in headers) {
parts.push(`${key}: ${(headers as any)[key]}`);
}