Skip to content

Commit

Permalink
Merge pull request midgetspy#320 from JonDough/master
Browse files Browse the repository at this point in the history
Add support for X-Forwarded-Host, X-Forwarded-Port and X-Forwarded-Proto
  • Loading branch information
midgetspy committed Mar 24, 2012
2 parents ecc87e9 + 1c26733 commit a392367
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sickbeard/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))+')'
Expand Down

0 comments on commit a392367

Please sign in to comment.