summaryrefslogtreecommitdiff
path: root/project1/proj1_s4498062/webhttp/resource.py
diff options
context:
space:
mode:
Diffstat (limited to 'project1/proj1_s4498062/webhttp/resource.py')
-rw-r--r--project1/proj1_s4498062/webhttp/resource.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/project1/proj1_s4498062/webhttp/resource.py b/project1/proj1_s4498062/webhttp/resource.py
index 9dd948c..9509f82 100644
--- a/project1/proj1_s4498062/webhttp/resource.py
+++ b/project1/proj1_s4498062/webhttp/resource.py
@@ -44,11 +44,13 @@ class Resource:
raise FileExistError
self.uri = uri
out = urlparse.urlparse(uri)
- self.path = os.path.join("content", out.path.lstrip("/"))
+ self.path = os.path.join(config('root', default='content'),
+ out.path.lstrip("/"))
if not os.path.exists(self.path):
raise FileExistError
if os.path.isdir(self.path):
- self.path = os.path.join(self.path, config('index'))
+ self.path = os.path.join(self.path,
+ config('index', default='index.html'))
if not os.path.exists(self.path):
raise FileAccessError
if not os.path.isfile(self.path):