Extra Cruft in Django URLs

I have a project that is over ten years old. I recently upgraded it to Django 4.1.x. I have a url that looks like this:

    re_path(
        r"^author/([a-z-]+)/post/([a-z0-9-]+)/$",
        research_views.display_article,
        name="display_article",
    ),

This is what I want to see in the browser's URL bar:

http://localhost:8000/author/hank-johnson/post/guam-tips-over/

But if I add extra cruft to the URL it gets displayed and never gets trimmed out of the URL bar.

http://localhost:8000/author/hank-johnson/post/guam-tips-over/?---adf

That's a problem because Google is now accumulating malformed URLs in its index.

How do I ensure that the final "/" is indeed the final slash and no extra cruft can be appended to the URL?

Back to Top