Created
February 11, 2021 20:55
-
-
Save an01f01/b48a8f9fed35eb6a57ce1303244f3330 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Overriding the prepare method of the RequestHandler to redirect based on protocol | |
""" | |
def prepare(self): | |
if self.request.protocol == 'http': | |
self.redirect('https://' + self.request.host, permanent=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment