[PR #7404] [MERGED] feat: add skipTrailingSlashes option to advanced config #7289

Closed
opened 2026-03-13 13:30:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7404
Author: @bytaesu
Created: 1/15/2026
Status: Merged
Merged: 1/16/2026
Merged by: @bytaesu

Base: canaryHead: 2026-01-16/feat/skip-trailing-slashes


📝 Commits (1)

  • 6f417c7 feat: add skipTrailingSlashes option to advanced config

📊 Changes

4 files changed (+66 additions, -1 deletions)

View changed files

📝 docs/content/docs/reference/options.mdx (+3 -1)
📝 packages/better-auth/src/api/index.test.ts (+56 -0)
📝 packages/better-auth/src/api/index.ts (+1 -0)
📝 packages/core/src/types/init-options.ts (+6 -0)

📄 Description

Note

useful when your framework automatically adds a trailing slash


Summary by cubic

Added an advanced config option to handle trailing slashes in route matching. This helps frameworks that auto-append slashes; default behavior remains strict (404 on trailing slashes).

  • New Features
    • Added advanced.skipTrailingSlashes to bypass trailing slash validation in the router.
    • Router respects the flag so trailing-slash requests reach endpoints.
    • Added tests for GET and POST with trailing slashes and updated the options reference docs.

Written for commit 6f417c706e. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7404 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/15/2026 **Status:** ✅ Merged **Merged:** 1/16/2026 **Merged by:** [@bytaesu](https://github.com/bytaesu) **Base:** `canary` ← **Head:** `2026-01-16/feat/skip-trailing-slashes` --- ### 📝 Commits (1) - [`6f417c7`](https://github.com/better-auth/better-auth/commit/6f417c706ea8478923bf054e10f539985c0191ac) feat: add skipTrailingSlashes option to advanced config ### 📊 Changes **4 files changed** (+66 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/reference/options.mdx` (+3 -1) 📝 `packages/better-auth/src/api/index.test.ts` (+56 -0) 📝 `packages/better-auth/src/api/index.ts` (+1 -0) 📝 `packages/core/src/types/init-options.ts` (+6 -0) </details> ### 📄 Description > [!NOTE] > useful when your framework automatically adds a trailing slash - Closes #6671 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added an advanced config option to handle trailing slashes in route matching. This helps frameworks that auto-append slashes; default behavior remains strict (404 on trailing slashes). - **New Features** - Added advanced.skipTrailingSlashes to bypass trailing slash validation in the router. - Router respects the flag so trailing-slash requests reach endpoints. - Added tests for GET and POST with trailing slashes and updated the options reference docs. <sup>Written for commit 6f417c706ea8478923bf054e10f539985c0191ac. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:30:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#7289