Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting www_root in CodeChecher server #4386

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading