Skip to content

Commit

Permalink
fix: normalize domains to hostname (resolves #486)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jun 22, 2022
1 parent d7bb617 commit 9f53d28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { resolve } from 'upath'
import defu from 'defu'
import { parseURL, withLeadingSlash } from 'ufo'
import { withLeadingSlash } from 'ufo'
import LruCache from 'lru-cache'
import type { Module } from '@nuxt/types'
import { setupStaticGeneration } from './generate'
Expand Down Expand Up @@ -40,7 +40,7 @@ const imageModule: Module<ModuleOptions> = async function imageModule (moduleOpt

// Normalize domains to hostname
options.domains = options.domains
.map(domain => parseURL(domain, 'https://').host)
.map(domain => new URL(domain, 'https://').hostname)
.filter(Boolean) as string[]

// Normalize alias to start with leading slash
Expand Down

0 comments on commit 9f53d28

Please sign in to comment.