uptime-monitor icon indicating copy to clipboard operation
uptime-monitor copied to clipboard

fix: resolve double slash in history URLs when baseUrl is configured

Open keith-oak opened this issue 4 months ago • 0 comments

Description

This PR fixes an issue where history URLs are generated with double slashes when baseUrl is configured in the status-website settings.

Problem

When a user configures their Upptime instance with:

status-website:
  baseUrl: /my-status-page

The generated history URLs in the README contain double slashes: https://username.github.io/repo-name//history/site-name

Solution

  1. Added baseUrl property to the status-website interface in interfaces.ts
  2. Created a joinUrlParts helper function that properly concatenates URL segments without creating double slashes
  3. Updated all history URL generation in summary.ts to use the helper function

Testing

The fix ensures that URLs are properly formed regardless of whether:

  • Only cname is configured
  • Only baseUrl is configured
  • Both cname and baseUrl are configured
  • Neither are configured (defaults to GitHub Pages URL)

Related Issues

Fixes upptime/upptime#170

keith-oak avatar Jun 12 '25 06:06 keith-oak