1. Oliver Tonnhofer
  2. mapproxy

Commits

Oliver Tonnhofer  committed 9890250

fix demo service on Windows

  • Participants
  • Parent commits a713e86
  • Branches 1.0.x

Comments (0)

Files changed (2)

File CHANGES.txt

View file
  • Ignore whitespace
+1.0.1 dev
+
+Fixes:
+- fixes demo on Windows (loaded static content from wrong path)
+
 1.0.0 2011-03-03
 
 - no changes since 1.0.0rc1

File mapproxy/service/demo.py

View file
  • Ignore whitespace
 
     def handle(self, req):
         if req.path.startswith('/demo/static/'):
-            filename = os.path.realpath(req.path).lstrip('/')
+            filename = os.path.realpath(req.path).lstrip(os.sep)
             static_file = os.path.join(os.path.dirname(__file__), 'templates', filename)
             type, encoding = mimetypes.guess_type(filename)
             return Response(open(static_file, 'rb'), content_type=type)