Skip to content

Commit

Permalink
Merge pull request #7931 from rtibbles/custom_channels_merge
Browse files Browse the repository at this point in the history
Add content serving on alternate origin.
  • Loading branch information
rtibbles authored Mar 27, 2021
2 parents ee28eb1 + 8ff0ba7 commit 781cadf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kolibri/utils/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def configure_http_server(port):
).lstrip("/")
content_dirs = [paths.get_content_dir_path()] + paths.get_content_fallback_paths()
dispatcher = MultiStaticDispatcher(content_dirs)
cherrypy.tree.mount(
content_handler = cherrypy.tree.mount(
None,
CONTENT_ROOT,
config={"/": {"tools.caching.on": False, "request.dispatch": dispatcher}},
Expand All @@ -323,7 +323,10 @@ def configure_http_server(port):
)

# Mount static files
alt_port_app = DjangoWhiteNoise(get_application(), **whitenoise_settings)
alt_port_app = wsgi.PathInfoDispatcher(
{"/": get_application(), CONTENT_ROOT: content_handler}
)
alt_port_app = DjangoWhiteNoise(alt_port_app, **whitenoise_settings)

alt_port_server = ServerAdapter(
cherrypy.engine,
Expand Down

0 comments on commit 781cadf

Please sign in to comment.