fix in routing
All checks were successful
Lint Code / lint (push) Successful in 39s
CI/CD Pipeline / lint (push) Successful in 0s
Run Tests / test (3.12) (push) Successful in 53s
Run Tests / test (3.13) (push) Successful in 51s
CI/CD Pipeline / test (push) Successful in 1s
CI/CD Pipeline / build-and-release (push) Has been skipped
CI/CD Pipeline / notify (push) Successful in 1s
All checks were successful
Lint Code / lint (push) Successful in 39s
CI/CD Pipeline / lint (push) Successful in 0s
Run Tests / test (3.12) (push) Successful in 53s
Run Tests / test (3.13) (push) Successful in 51s
CI/CD Pipeline / test (push) Successful in 1s
CI/CD Pipeline / build-and-release (push) Has been skipped
CI/CD Pipeline / notify (push) Successful in 1s
This commit is contained in:
parent
1b462bd5f0
commit
2d445462c2
@ -22,18 +22,11 @@ extensions:
|
|||||||
- type: routing
|
- type: routing
|
||||||
config:
|
config:
|
||||||
regex_locations:
|
regex_locations:
|
||||||
"=/":
|
|
||||||
root: "./docs"
|
|
||||||
index_file: "index.html"
|
|
||||||
|
|
||||||
"~*\\.(css)$":
|
"~*\\.(css)$":
|
||||||
root: "./docs"
|
root: "./docs"
|
||||||
cache_control: "public, max-age=3600"
|
cache_control: "public, max-age=3600"
|
||||||
|
|
||||||
"~*\\.html$":
|
|
||||||
root: "./docs"
|
|
||||||
cache_control: "no-cache"
|
|
||||||
|
|
||||||
"__default__":
|
"__default__":
|
||||||
root: "./docs"
|
root: "./docs"
|
||||||
index_file: "index.html"
|
index_file: "index.html"
|
||||||
|
cache_control: "no-cache"
|
||||||
|
|||||||
@ -123,6 +123,10 @@ class RequestHandler:
|
|||||||
file_path = root / index_file
|
file_path = root / index_file
|
||||||
else:
|
else:
|
||||||
file_path = root / path
|
file_path = root / path
|
||||||
|
# If path is a directory, look for index file
|
||||||
|
if file_path.is_dir():
|
||||||
|
index_file = config.get("index_file", "index.html")
|
||||||
|
file_path = file_path / index_file
|
||||||
|
|
||||||
try:
|
try:
|
||||||
file_path = file_path.resolve()
|
file_path = file_path.resolve()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user