Skip to content

Commit

Permalink
server: do not attempt to serve directories or hidden files
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Nov 30, 2023
1 parent 0721cd9 commit 0ff5515
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pypath/omnipath/server/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,15 @@ def _set_www_root(self):

def _local_path(self, request):

if request.postpath and request.postpath[-1].startswith('_'):
if request.postpath and request.postpath[-1][0] in ('_', '.'):

return

for wwwroot in (self.wwwroot, self.wwwbuiltin):

path = os.path.join(wwwroot, *request.postpath)

if os.path.exists(path):
if os.path.isfile(path):

return path

Expand Down

0 comments on commit 0ff5515

Please sign in to comment.