remove unused func

This commit is contained in:
HorizonCode 2023-05-12 10:18:35 +02:00
parent 60b819b9a4
commit ee384eb4bc

8
mod.ts
View File

@ -328,18 +328,12 @@ export class RouteRequest {
this.headers = request.headers;
this.method = request.method as HTTPMethod;
this.pathParams = {};
this.queryParams = this.paramsToObject(new URL(url).searchParams.entries());
this.queryParams = Object.fromEntries(new URL(url).searchParams.entries());
this.remoteIpAddr = "hostname" in conn.remoteAddr
? conn.remoteAddr["hostname"]
: "127.0.0.1";
}
private paramsToObject(
entries: IterableIterator<[string, string]>,
): { [key: string]: string } {
return Object.fromEntries(entries);
}
header(name: string): unknown {
const matchingHeader = Array.from(this.headers.keys()).find((headerName) =>
headerName === name