saber
saber copied to clipboard
Fix #457: force trailing slash in the backend side
Summary This PR forcing a redirect to any URL without a trailing slash '/' in the end. This PR is to close : https://github.com/saberland/saber/issues/457
What kind of change does this PR introduce? (check at least one)
- [x] Bugfix
- [ ] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Docs
- [ ] Build-related changes
- [ ] Other, please describe:
If changing the UI/CSS related code, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
- [ ] Yes
- [x] No
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
- [x] Briefly describing what this PR does in the title in Angular Commit Message Conventions, e.g.
fix: rebuild when a page is added
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information:
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
IssueHunt has been backed by the following sponsors. Become a sponsor
Deploy preview for saber ready!
Built with commit f583beda95d35ef7356afc0abfd2ccbf4576cee6
https://deploy-preview-470--saber.netlify.com
This is a demo from my localhost
I'm not sure why it's not working on netlify, should I place my changes somewhere else?
Your change will only apply to our dev server, in production it's built into static HTML files.
Would it make more sense that this setting is only applied when the user-specifies what the permalinks are?
For example
# Default values:
permalinks:
post: /:year/:month/:day/:slug.html
page: /:slug.html
permalinks:
post: /:year/:month/:day/:slug
page: /:slug
permalinks:
post: /:year/:month/:day/:slug/
page: /:slug/
Or perhaps it needs to be broken into its own setting?
@limitlessloop I searched a lot I found that it might be achievable by Vue Router: http://jsfiddle.net/L7hscd8h/9377/
we map routes here : https://github.com/saberland/saber/blob/6afe8fa01535900c361e6b23ef70b2aedb9ca055/packages/saber/vue-renderer/app/router.js#L4
and ensure all routes have a trailing slash. and setpathToRegexpOptions: { strict: true }
to the routes, will it work?