Skip to content

Commit

Permalink
Merge pull request #4386 from Discookie/www-root-fix
Browse files Browse the repository at this point in the history
Fix setting www_root in CodeChecher server
  • Loading branch information
bruntib authored Nov 25, 2024
2 parents c752814 + 776f107 commit d86df7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/server/codechecker_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ class RequestHandler(SimpleHTTPRequestHandler):
def __init__(self, request, client_address, server):
self.path = None
super().__init__(request, client_address, server)
# GET requests are served from www_root.
self.directory = server.www_root

def log_message(self, *args):
""" Silencing http server. """
Expand Down Expand Up @@ -214,6 +212,9 @@ def do_GET(self):
RequestHandler._get_client_host_port(self.client_address)
self.auth_session = self.__check_session_cookie()

# GET requests are served from www_root.
self.directory = self.server.www_root

username = self.auth_session.user if self.auth_session else 'Anonymous'
LOG.debug("%s:%s -- [%s] GET %s",
client_host if not is_ipv6 else '[' + client_host + ']',
Expand Down Expand Up @@ -244,7 +245,6 @@ def do_GET(self):
self.path = "index.html"

# Check that the given path is a file.
# The base directory is set to www_root.
if not os.path.exists(self.translate_path(self.path)):
self.path = 'index.html'

Expand Down

0 comments on commit d86df7a

Please sign in to comment.