question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change router's `trailing_slash` option

See original GitHub issue

Hi, Is there a way to change the trailing_slash option for the included rest auth URLs?

Thanks

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kevinmanncitocommented, Jul 12, 2017

I don’t even know that it should be an optional setting. What would be the issue with just having the urls always work with or without a slash? For my DRF endpoints I almost always just do this:

r'^endpoint/?$' instead of the typical: r'^endpoint/$'

Does anyone see any issues with making this change to the url confs?

0reactions
awwestercommented, Oct 3, 2016

Yeah there are definitely multiple workarounds on the frontend or the backend. In most all of the projects I’ve worked on the frontend devs tend to want URLs without trailing slashes (it’s kind of the norm outside of the Django world). I find it cleaner to just override the auth urls and remove the trailing slash rather than tell them to use trailing slashes.

Also it’s in Django Rest Framework, and with this being an extension of DRF it would be nice to support trailing slashes in a similar fashion. I’ll be putting together a PR for an optional setting and see what the feedback is. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature request: Normalize trailing slashed by default #8022
Many users have expressed concern that useRouteMatch returns the trailing slash in matching URLs, which makes joining them with path segments unpredictable ...
Read more >
Trailing Slash - next.config.js
By default Next.js will redirect urls with trailing slashes to their counterpart without a trailing slash. For example /about/ will redirect to /about...
Read more >
Trailing Slashes and Gatsby - Jon
Reach Router made a choice to ignore trailing slashes completely, therefore eliminating any difference when navigating up the path. Where that ...
Read more >
To slash or not to slash | Google Search Central Blog
Historically, it's common for URLs with a trailing slash to indicate a directory, and those without a trailing slash to denote a file:....
Read more >
Should You Have a Trailing Slash at the End of URLs? - Ahrefs
If you go to Settings > Permalinks, you can change whether you use a trailing slash if you use a custom structure. /%postname%/...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found