Putting / at end of domain results in error InvalidArgumentException: Source path has to start with a slash.

Created on 21 October 2024, 6 months ago

Problem/Motivation

10.3+ sites generate error pages now if a double / is requested for example www.example.com/ works but www.example.com// generates an error. 10.2 and below the homepage would load correctly.

Expected behavior is the CMS handle the accidental // and load the correct page. This typo mistake can often happen after people modify URLs manually to travel to a parent page.

Steps to reproduce

1. Visit a websites homepage www.example.com/
2. Manually add a / to the URL so its www.example.com// and visit to see error

Proposed resolution

Maintain 10.2 and below behavior where the homepage would load even with the extra / added and users would not see error pages. Maybe they should at minimum see a 404 or something but not an error page?

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

10.3 ✨

Component

path.module

Created by

πŸ‡ΊπŸ‡ΈUnited States NicholasS

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @NicholasS
  • I haven't been able to reproduce this bug report as written. I did the following:

    1. Built a 10.3.6 site on https://simplytest.me.
    2. Browsed to https://master-<random hostname simplytest creates>.tugboatqa.com//

    There was not an HTTP error. The page loaded.

    Because you have a site that reproduces this bug we need to find out from you the other conditions required to trigger it.

  • Status changed to Closed: cannot reproduce 2 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    This is not reproducible on 10.4.0 either. Since there hasn't been any further details supplied,

    Therefore, closing as cannot reproduce. If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue β†’ starting from "Install Drupal core".

    Thanks!

Production build 0.71.5 2024