Skip to content

Commit

Permalink
fix: workaround downstream dependency issues messing with http
Browse files Browse the repository at this point in the history
ref #154
  • Loading branch information
panva committed Jan 20, 2021
1 parent 7759a1b commit 2e58005
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/runtime/node/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { get as http } from 'http'
import type { ClientRequest } from 'http'
import type { URL as URLtype } from 'url'
import { get as https, RequestOptions } from 'https'

import type { FetchFunction } from '../interfaces.d'
Expand All @@ -20,7 +19,7 @@ const fetch: FetchFunction = async (url: URL, timeout: number, options: Accepted
}
return new Promise((resolve, reject) => {
const { agent } = options
protocols[url.protocol](<URLtype>url, { agent, timeout }, async (response) => {
protocols[url.protocol](url.href, { agent, timeout }, async (response) => {
if (response.statusCode !== 200) {
reject(new JOSEError('Expected 200 OK from the JSON Web Key Set HTTP response'))
} else {
Expand Down

0 comments on commit 2e58005

Please sign in to comment.