From bbce15ea1de92bf3f623062081404dbf26464feb Mon Sep 17 00:00:00 2001 From: Serge Tymoshenko <65758149+sergetymo@users.noreply.github.com> Date: Tue, 7 Dec 2021 15:17:18 +0200 Subject: [PATCH] Ditch urlParse in favor of new URL() (#3) --- classes/Request.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/classes/Request.ts b/classes/Request.ts index 7a4617f..5d0ab7f 100644 --- a/classes/Request.ts +++ b/classes/Request.ts @@ -1,5 +1,3 @@ -import { urlParse } from '../deps.ts' - export class Request { public protocol: string public host: string @@ -7,8 +5,7 @@ export class Request { public params?: URLSearchParams constructor (requestString: string) { - // TODO: ditch urlParse in favor of new URL() - const url = urlParse(requestString) + const url = new URL(requestString) this.protocol = url.protocol || 'gemini:' this.host = url.hostname this.path = url.pathname || ''