GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — The pathParse function in RescriptReactRouter.res currently treats single slash and double slash URLs identically, which causes routing conflicts and prevents proper URL differentiation. · Issue #145 · rescript-lang/rescript-react

The pathParse function in RescriptReactRouter.res currently treats single slash and double slash URLs identically, which causes routing conflicts and prevents proper URL differentiation. #145

New issue
Copy link
New issue
Copy link
Open
Open
The pathParse function in RescriptReactRouter.res currently treats single slash and double slash URLs identically, which causes routing conflicts and prevents proper URL differentiation.#145
Copy link

Description

@harshit-juspay
harshit-juspay
opened on Sep 17, 2025
Issue body actions

Current Behavior

// Both URLs return the same parsed result
pathParse("/analytics-transaction") → list{"analytics-transaction"}
pathParse("//analytics-transaction") → list{"analytics-transaction"} // Problem!

Expected Behavior

// URLs should parse differently to enable proper routing
pathParse("/analytics-transaction") → list{"analytics-transaction"}
pathParse("//analytics-transaction") → list{"", "analytics-transaction"} // Should preserve leading empty string

Impact

  • Cannot differentiate between /path and //path in routing logic
  • Causes "Page Not Found" errors for valid double slash URLs
  • Breaks routing patterns that rely on double slash prefixes

Proposed Solution

Modify the filter logic to preserve the first empty string while removing others:
// Current problematic code
raw->Js.String2.split("/")->Js.Array2.filter(item => item->Js.String2.length != 0)->arrayToList

// Proposed fix
let splitArray = raw->Js.String2.split("/")
let filteredArray = []
splitArray->Js.Array2.forEachi((item, index) => {
if item->Js.String2.length != 0 || index == 0 {
filteredArray->Js.Array2.push(item)->ignore
}
})
filteredArray->arrayToList

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.