Skip to content

Commit

Permalink
Merge branch 'master' of github.com:SmartTeleMax/iktomi
Browse files Browse the repository at this point in the history
  • Loading branch information
Harut committed Jun 9, 2015
2 parents d9370db + 9c758cf commit 772e6db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion iktomi/web/filters.py
Expand Up @@ -8,7 +8,7 @@
from os import path
import posixpath
from urllib import unquote
from webob.exc import HTTPMethodNotAllowed
from webob.exc import HTTPMethodNotAllowed, HTTPNotFound
from webob.static import FileApp
from .core import WebHandler, cases
from . import Response
Expand Down Expand Up @@ -335,6 +335,8 @@ def translate_path(self, pth):

def static_files(self, env, data):
path_info = unquote(env.request.path)
if path_info.endswith('/'):
raise HTTPNotFound
if path_info.startswith(self.url):
file_path = self.translate_path(path_info[len(self.url):])
if file_path and path.exists(file_path) and path.isfile(file_path):
Expand Down

0 comments on commit 772e6db

Please sign in to comment.