Skip to content
Snippets Groups Projects
Commit 484665d3 authored by WURBEL Eric's avatar WURBEL Eric
Browse files

correction has_section

parent 9a363215
No related branches found
No related tags found
No related merge requests found
...@@ -69,3 +69,7 @@ class Config: ...@@ -69,3 +69,7 @@ class Config:
def get(self, section, key): def get(self, section, key):
"""Return a configuration value.""" """Return a configuration value."""
return self.cfg.get(section, key, fallback=None) return self.cfg.get(section, key, fallback=None)
def has_section(self, s):
"""Tests if a section exist"""
return self.cfg.has_section(s)
...@@ -206,7 +206,7 @@ class Request: ...@@ -206,7 +206,7 @@ class Request:
host = self.get_header_field('Host') host = self.get_header_field('Host')
if host is not None: if host is not None:
host = host.split(':', 1)[0] # get rid of optional port host = host.split(':', 1)[0] # get rid of optional port
if host is not None and self.cfg.section_exists(host): if host is not None and self.cfg.has_section(host):
tmp = self.cfg.get(host, 'documentroot') tmp = self.cfg.get(host, 'documentroot')
if tmp is not None: if tmp is not None:
docroot = tmp docroot = tmp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment