Skip to content

Commit f8b769b

Browse files
committed
Use url exported from the util of json-schema-ref-parser dependency
1 parent ef4a23e commit f8b769b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22

33
const util = require("util");
4-
const { URL } = require("url");
4+
const url = require("@apidevtools/json-schema-ref-parser/lib/util/url");
55

66
exports.format = util.format;
77
exports.inherits = util.inherits;
@@ -27,7 +27,7 @@ const operationsList = ["get", "post", "put", "delete", "patch", "options", "hea
2727
function fixServers (server, path) {
2828
// Server url starting with "/" tells that it is not an http(s) url
2929
if (server.url && server.url.startsWith("/")) {
30-
const inUrl = new URL(path);
30+
const inUrl = url.parse(path);
3131
const finalUrl = inUrl.protocol + "//" + inUrl.hostname + server.url;
3232
server.url = finalUrl;
3333
return server;

0 commit comments

Comments
 (0)