Repository navigation
Conversation
@iconify/vue 5.0.5 ships `https://api2.iconify.design` next to the old `https://api.iconify.design` in its default provider. The check added in nuxt#565 only knew the single old host, so it assumed the app had set a provider itself and never switched to Nuxt's local API. Match the host pattern instead of a fixed list. That also covers a future `api3` without another release here, while lookalike domains stay untouched.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
commit: |
🔗 Linked issue
Fixes #571
📚 Description
@iconify/vue@5.0.5changed its default provider fromto
The check added in #565 compares the current provider against that exact host list. With 5.0.5 the comparison fails, so Nuxt assumes the app configured a provider itself and never registers its local API. The client then loads icons from the public Iconify API even though
provider: 'server'is the default.This detects Iconify's public hosts by pattern instead of by a fixed list:
I considered adding
api2.iconify.designto the existing array, but the same bug would come back as soon as Iconify shipsapi3. The host pattern keeps working for future hosts, and it can only matchapi,api2,api42, ... oniconify.design.Anything that doesn't match is treated as a provider set by the app and is left alone. The anchoring matters here: lookalike domains must never be mistaken for Iconify's API.
https://api.iconify.design/api/_nuxt_iconhttps://api2.iconify.designhttps://api42.iconify.designhttps://api.iconify.design.evil.comhttps://api.iconify.design@evil.comhttps://evil.com/https://api.iconify.designhttp://api.iconify.designhttps://api-2.iconify.designhttps://apiiconify.designhttps://icons.example.com🧪 Tests
it.eachcases for the hosts above, so the boundary of the check is covered.@iconify/vueinstead of hard-coding it. That hard-coded value is what hid the bug.pnpm testpasses (133 unit tests, playground e2e, both fixture builds), along withlint,buildandtypecheck.https://api.iconify.design/lucide.json?icons=rocket, after it requests/api/_nuxt_icon/lucide.json?icons=rocket.