Change record status: 
Introduced in branch: 
4.x
Introduced in version: 
4.0.22
Description: 

Base URLs saved via the environment switcher form now have any trailing slashes removed during form validation.

This applies to all URLs entered via the UI form at:
/admin/config/development/environment-indicator/switcher/add
and
/admin/config/development/environment-indicator/{machine}/edit.

To enforce consistency across existing sites, a post-update hook was added to clean up existing saved configuration.

This ensures consistent URL matching behavior and avoids subtle mismatches caused by trailing slashes.

No configuration changes are required — this fix is applied automatically via the update hook. However, any code that compares switcher URLs should expect a normalized (no trailing slash) value.

Impacts: 
Site builders, administrators, editors