withastro / adapters

Home for Astro's core maintained adapters
70 stars 41 forks source link

fix(netlify): correctly handle local images with fully-qualified URLs #401

Closed ascorbic closed 1 month ago

ascorbic commented 2 months ago

Changes

Netlify Image CDN expects local images to just have the path. If passed the full URL it will need to handle domain allowlists, and it breaks locally. This PR detects those cases where an image URL is actually local and changes them to just use the path.

Testing

Added test cases

Docs

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: 76c89374992b148ff1ac3a82f7046b5b9156e0b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ---------------------------------- | ----- | | @astrojs/netlify | Patch | | @test/netlify-hosted-astro-project | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

ascorbic commented 1 month ago

Closing because I'm not sure this is somethign we should be encouraging