Permalink
Browse files

Merge pull request #320 from JonDough/master

Add support for X-Forwarded-Host, X-Forwarded-Port and X-Forwarded-Proto
  • Loading branch information...
2 parents ecc87e9 + 1c26733 commit a392367b16b197ca59a5017f5ecfb37ade2f26f4 @midgetspy midgetspy committed Mar 24, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 sickbeard/webserve.py
View
@@ -69,6 +69,14 @@ def __init__(self, *args, **KWs):
self.sbHost = re.match("[^:]+", cherrypy.request.headers['Host'], re.X|re.M|re.S).group(0)
self.projectHomePage = "http://code.google.com/p/sickbeard/"
+ if "X-Forwarded-Host" in cherrypy.request.headers:
+ self.sbHost = cherrypy.request.headers['X-Forwarded-Host']
+ if "X-Forwarded-Port" in cherrypy.request.headers:
+ self.sbHttpPort = cherrypy.request.headers['X-Forwarded-Port']
+ self.sbHttpsPort = self.sbHttpPort
+ if "X-Forwarded-Proto" in cherrypy.request.headers:
+ self.sbHttpsEnabled = True if cherrypy.request.headers['X-Forwarded-Proto'] == 'https' else False
+
logPageTitle = 'Logs & Errors'
if len(classes.ErrorViewer.errors):
logPageTitle += ' ('+str(len(classes.ErrorViewer.errors))+')'

0 comments on commit a392367

Please sign in to comment.