mirror of
https://github.com/django/daphne.git
synced 2025-07-10 16:02:18 +03:00
Fix #449: root_path was ending up as None
This commit is contained in:
parent
b52e2e06d7
commit
5a38171fc7
|
@ -182,8 +182,8 @@ class AsgiHandler(base.BaseHandler):
|
||||||
self.load_middleware()
|
self.load_middleware()
|
||||||
|
|
||||||
def __call__(self, message):
|
def __call__(self, message):
|
||||||
# Set script prefix from message root_path
|
# Set script prefix from message root_path, turning None into empty string
|
||||||
set_script_prefix(message.get('root_path', ''))
|
set_script_prefix(message.get('root_path', '') or '')
|
||||||
signals.request_started.send(sender=self.__class__, message=message)
|
signals.request_started.send(sender=self.__class__, message=message)
|
||||||
# Run request through view system
|
# Run request through view system
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -84,7 +84,7 @@ class Command(RunserverCommand):
|
||||||
action_logger=self.log_action,
|
action_logger=self.log_action,
|
||||||
http_timeout=self.http_timeout,
|
http_timeout=self.http_timeout,
|
||||||
ws_protocols=getattr(settings, 'CHANNELS_WS_PROTOCOLS', None),
|
ws_protocols=getattr(settings, 'CHANNELS_WS_PROTOCOLS', None),
|
||||||
root_path=getattr(settings, 'FORCE_SCRIPT_NAME', ''),
|
root_path=getattr(settings, 'FORCE_SCRIPT_NAME', '') or '',
|
||||||
).run()
|
).run()
|
||||||
self.logger.debug("Daphne exited")
|
self.logger.debug("Daphne exited")
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user