Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function serialize (cmpts, opts) {
uriTokens.push(components.scheme, ':')
}

const authority = recomposeAuthority(components, options)
const authority = recomposeAuthority(components)
if (authority !== undefined) {
if (options.reference !== 'suffix') {
uriTokens.push('//')
Expand Down Expand Up @@ -223,7 +223,7 @@ function parse (uri, opts) {
if (parsed.host) {
const ipv4result = normalizeIPv4(parsed.host)
if (ipv4result.isIPV4 === false) {
const ipv6result = normalizeIPv6(ipv4result.host, { isIPV4: false })
const ipv6result = normalizeIPv6(ipv4result.host)
parsed.host = ipv6result.host.toLowerCase()
isIP = ipv6result.isIPV6
} else {
Expand Down
6 changes: 3 additions & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function getIPV6 (input) {
return output
}

function normalizeIPv6 (host, opts = {}) {
function normalizeIPv6 (host) {
if (findToken(host, ':') < 2) { return { host, isIPV6: false } }
const ipv6 = getIPV6(host)

Expand Down Expand Up @@ -199,7 +199,7 @@ function normalizeComponentEncoding (components, esc) {
return components
}

function recomposeAuthority (components, options) {
function recomposeAuthority (components) {
const uriTokens = []

if (components.userinfo !== undefined) {
Expand All @@ -214,7 +214,7 @@ function recomposeAuthority (components, options) {
if (ipV4res.isIPV4) {
host = ipV4res.host
} else {
const ipV6res = normalizeIPv6(ipV4res.host, { isIPV4: false })
const ipV6res = normalizeIPv6(ipV4res.host)
if (ipV6res.isIPV6 === true) {
host = `[${ipV6res.escapedHost}]`
} else {
Expand Down