Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/middleware for referer redirect #286

Merged
merged 3 commits into from
Apr 4, 2024

Conversation

Nout-Prins
Copy link
Contributor

Description

Created a middleware that stores the last visited page in the session. This can be used when redirecting someone back to the previous page. And replaced the referer that was used.

The code used to check if a request is indeed a page switching request works when I tested it by clicking through pages. But I am not sure if it will work in any scenario, if anyone knows something better than

request.method == "GET" and 'text/html' in request.headers.get('Accept', ''):

That would be great!

Checklist

  • Ran the Black Formatter and
    djLint-er on any new code
    (checks
    will
    fail without)
  • Made any changes or additions to the documentation where required
  • Changes generate no new warnings/errors
  • New and existing unit tests pass locally with my
    changes

What type of PR is this?

  • 🐛 Bug Fix

Added/updated tests?

  • 🙋 no, because I need help

Related PRs, Issues etc

  • Related Issue #
  • Closes #

@TreyWW TreyWW merged commit 0478715 into TreyWW:main Apr 4, 2024
18 checks passed
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.

2 participants