Skip to content

Commit

Permalink
Ditch urlParse in favor of new URL() (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergetymo authored Dec 7, 2021
1 parent a559154 commit bbce15e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions classes/Request.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { urlParse } from '../deps.ts'

export class Request {
public protocol: string
public host: string
public path: string
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 || ''
Expand Down

0 comments on commit bbce15e

Please sign in to comment.