Skip to content

fix: filter Laravel route false positives#65

Open
mariomeyer wants to merge 1 commit intoDeusData:mainfrom
mariomeyer:fix/laravel-route-false-positives
Open

fix: filter Laravel route false positives#65
mariomeyer wants to merge 1 commit intoDeusData:mainfrom
mariomeyer:fix/laravel-route-false-positives

Conversation

@mariomeyer
Copy link

@mariomeyer mariomeyer commented Mar 16, 2026

Summary

  • Filters out matched paths containing $ or : in extractLaravelRoutes() — these are non-route strings (cache keys, interpolated expressions) that happen to match the route regex, not actual URL path definitions
  • Laravel route parameters use {param} syntax, so valid routes are unaffected

Test plan

  • Run existing httplink tests: go test ./internal/httplink/ -v
  • Verify cache-key patterns like article:{$this->id}:image are filtered
  • Verify valid routes like GET /api/users/{id} still pass through

Scope source-based route extractors to their target file extensions
(Go→.go, Express→.js/.ts, Laravel→.php, Ktor→.kt/.kts) to prevent
cross-framework regex matches. The Ktor regex `\b(get|...)\("..."\)`
was matching PHP `Cache::get("cache_key")` calls as routes because
`\b` treats `::` as a word boundary.

Also add a secondary guard in extractLaravelRoutes to skip paths
containing `$` or `:` characters (cache keys, interpolated strings).
@mariomeyer mariomeyer force-pushed the fix/laravel-route-false-positives branch from c8878ea to 0c07562 Compare March 16, 2026 14:51
@gitokato
Copy link

Looks like #66 handles this a bit more gracefully.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants