Skip to content

Commit

Permalink
Fix auto redirect for ipv6
Browse files Browse the repository at this point in the history
This fixes the auto redirect for IPv6.  It was tested with the latest
Safari, Firefox and Chrome on Mac and the latest IE, Firefox and Chrome
on Windows.
  • Loading branch information
xombiemp committed Mar 1, 2012
1 parent 2020a41 commit 11364f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sickbeard/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ def __init__(self, *args, **KWs):
self.sbHttpPort = sickbeard.WEB_PORT
self.sbHttpsPort = sickbeard.WEB_PORT
self.sbHttpsEnabled = sickbeard.ENABLE_HTTPS
self.sbHost = re.match("[^:]+", cherrypy.request.headers['Host'], re.X|re.M|re.S).group(0)
if cherrypy.request.headers['Host'][0] == '[':
self.sbHost = re.match("^\[.*\]", cherrypy.request.headers['Host'], re.X|re.M|re.S).group(0)
else:
self.sbHost = re.match("^[^:]+", cherrypy.request.headers['Host'], re.X|re.M|re.S).group(0)
self.projectHomePage = "http://code.google.com/p/sickbeard/"

logPageTitle = 'Logs & Errors'
Expand Down Expand Up @@ -1943,6 +1946,8 @@ def is_alive(self, *args, **kwargs):
return "Error: Unsupported Request. Send jsonp request with 'callback' variable in the query stiring."
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
cherrypy.response.headers['Content-Type'] = 'text/javascript'
cherrypy.response.headers['Access-Control-Allow-Origin'] = '*'
cherrypy.response.headers['Access-Control-Allow-Headers'] = 'x-requested-with'

if sickbeard.started:
return callback+'('+json.dumps({"msg": str(sickbeard.PID)})+');'
Expand Down

0 comments on commit 11364f9

Please sign in to comment.