#12662: Enforce Hostname Middleware ---------------------------+------------------------------------------------ Reporter: robballou | Owner: nobody Status: new | Milestone: Component: Uncategorized | Version: 1.1 Keywords: | Stage: Unreviewed Has_patch: 1 | ---------------------------+------------------------------------------------ For a recent project, I wanted to be able to enforce the hostname used in requests to a single domain (in this case, any requests like "www.example.com" would redirect to "example.com"). Rather than use the redirect app, I felt this was better suited to middleware like the {{{ PREPEND_WWW }}} setting. So the following middleware will allow users to set an {{{ ENFORCE_HOSTNAME }}} setting for a single or multiple hosts (string or list).
I wasn't sure how to submit a patch for the middleware itself, so that is just attached as a file. I did create tests for the middleware though. -- Ticket URL: <http://code.djangoproject.com/ticket/12662> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.