uptime-monitor
uptime-monitor copied to clipboard
fix: resolve double slash in history URLs when baseUrl is configured
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
- Added
baseUrlproperty to thestatus-websiteinterface ininterfaces.ts - Created a
joinUrlPartshelper function that properly concatenates URL segments without creating double slashes - Updated all history URL generation in
summary.tsto use the helper function
Testing
The fix ensures that URLs are properly formed regardless of whether:
- Only
cnameis configured - Only
baseUrlis configured - Both
cnameandbaseUrlare configured - Neither are configured (defaults to GitHub Pages URL)
Related Issues
Fixes upptime/upptime#170