Skip to content

fix(ipxStatic): strip repeated slashes from image path#1801

Merged
danielroe merged 2 commits into
mainfrom
fix/static-slashes
Apr 6, 2025
Merged

fix(ipxStatic): strip repeated slashes from image path#1801
danielroe merged 2 commits into
mainfrom
fix/static-slashes

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

when using ipx in a static deployment, double slashes can lead to 404s on some providers. (this occurs when transforming images on external domains). we can solve by stripping them.

context: https://github.com/danielroe/roe.dev/blob/7704f70db1c756f28f557bd13875a29b11419ef7

@danielroe danielroe requested a review from pi0 April 5, 2025 08:30
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying nuxt-image with  Cloudflare Pages  Cloudflare Pages

Latest commit: 356a842
Status: ✅  Deploy successful!
Preview URL: https://b79ba9d2.nuxt-image.pages.dev
Branch Preview URL: https://fix-static-slashes.nuxt-image.pages.dev

View logs

@pkg-pr-new

pkg-pr-new Bot commented Apr 5, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@1801

commit: 356a842

@codecov-commenter

codecov-commenter commented Apr 5, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 5.55556% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.64%. Comparing base (5dcaea2) to head (356a842).
⚠️ Report is 297 commits behind head on main.

Files with missing lines Patch % Lines
src/runtime/providers/ipxStatic.ts 0.00% 16 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1801      +/-   ##
==========================================
- Coverage   62.91%   62.64%   -0.27%     
==========================================
  Files          81       81              
  Lines        3772     3788      +16     
  Branches      431      431              
==========================================
  Hits         2373     2373              
- Misses       1371     1387      +16     
  Partials       28       28              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@danielroe danielroe merged commit 6b7ae04 into main Apr 6, 2025
@danielroe danielroe deleted the fix/static-slashes branch April 6, 2025 14:22
This was referenced Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants