Skip to content

Fix restrictLayoutsTo containment checks for absolute paths#279

Open
boracomet wants to merge 1 commit intoTryGhost:mainfrom
boracomet:codex/restrict-layouts-path-check
Open

Fix restrictLayoutsTo containment checks for absolute paths#279
boracomet wants to merge 1 commit intoTryGhost:mainfrom
boracomet:codex/restrict-layouts-path-check

Conversation

@boracomet
Copy link

@boracomet boracomet commented Feb 8, 2026

What this fixes

  • Replaces the startsWith path check in cacheLayout with a path.relative containment check.
  • Correctly handles cases where restrictLayoutsTo is relative and the layout path is absolute.
  • Blocks sibling-prefix bypasses (e.g. /allowed vs /allowed-evil).

Tests added

  • Allows absolute layout paths when restrictLayoutsTo is relative.
  • Rejects layouts that only match restrictLayoutsTo by string prefix.

Fixes #270

@cursor
Copy link

cursor bot commented Feb 8, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 3.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@coderabbitai
Copy link

coderabbitai bot commented Feb 8, 2026

Warning

Rate limit exceeded

@boracomet has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 25 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

restrictLayoutsTo check fails on valid absolute paths

1 participant