Skip to content

Commit

Permalink
app_terminal.py: Fixed a bug where plugin 'Web' handlers were not wor…
Browse files Browse the repository at this point in the history
…king properly with the url_prefix setting.
  • Loading branch information
liftoff committed Nov 3, 2015
1 parent fe14352 commit f7a9be4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gateone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__version_info__ = (1, 2, 0)
__license__ = "AGPLv3" # ...or proprietary (see LICENSE.txt)
__author__ = 'Dan McDougall <[email protected]>'
__commit__ = "20151103081614" # Gets replaced by git (holds the date/time)
__commit__ = "20151103083231" # Gets replaced by git (holds the date/time)

import os
GATEONE_DIR = os.path.dirname(os.path.abspath(__file__))
Expand Down
2 changes: 2 additions & 0 deletions gateone/applications/terminal/app_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2845,6 +2845,8 @@ def init(settings):
for hooks in plugin_hooks.values():
if 'Web' in hooks:
for handler in hooks['Web']:
if not handler[0].startswith(url_prefix): # Fix it
handler = (url_prefix + handler[0].lstrip('/'), handler[1])
if handler in REGISTERED_HANDLERS:
continue # Already registered this one
else:
Expand Down
5 changes: 2 additions & 3 deletions gateone/core/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
}
__author__ = 'Dan McDougall <[email protected]>'
__commit__ = "20151103081614" # Gets replaced by git (holds the date/time)
__commit__ = "20151103083231" # Gets replaced by git (holds the date/time)

# NOTE: Docstring includes reStructuredText markup for use with Sphinx.
__doc__ = '''\
Expand Down Expand Up @@ -995,7 +995,6 @@ class MainHandler(BaseHandler):
"""
@tornado.web.authenticated
@tornado.web.addslash
# TODO: Get this auto-minifying gateone.js
def get(self):
# Set our server header so it doesn't say TornadoServer/<version>
hostname = os.uname()[1]
Expand Down Expand Up @@ -3717,7 +3716,7 @@ def __init__(self, settings, **kwargs):
(r"%sstatic/(.*)" % url_prefix, StaticHandler, {"path": static_url}
))
# Hook up the hooks
for plugin_name, hooks in PLUGIN_HOOKS.items():
for hooks in PLUGIN_HOOKS.values():
if 'Web' in hooks:
# Apply the plugin's Web handlers
fixed_hooks = []
Expand Down
2 changes: 1 addition & 1 deletion gateone/static/gateone.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f7a9be4

Please sign in to comment.