Author: humbedooh
Date: Tue Jan  5 12:31:26 2016
New Revision: 1723055

URL: http://svn.apache.org/viewvc?rev=1723055&view=rev
Log:
Fixes for standalone server:
- Fix basic auth checks
- Fix base URL (should be htdocs, not www)

Modified:
    steve/trunk/pysteve/standalone.py

Modified: steve/trunk/pysteve/standalone.py
URL: 
http://svn.apache.org/viewvc/steve/trunk/pysteve/standalone.py?rev=1723055&r1=1723054&r2=1723055&view=diff
==============================================================================
--- steve/trunk/pysteve/standalone.py (original)
+++ steve/trunk/pysteve/standalone.py Tue Jan  5 12:31:26 2016
@@ -19,6 +19,7 @@
 
 portno = 8080
 
+
 import BaseHTTPServer
 import CGIHTTPServer
 from SocketServer import ThreadingMixIn
@@ -73,7 +74,7 @@ class pysteveHTTPHandler(handler):
                     return
                 else:
                     authed = False
-                    auth = 
self.headers.getheader('Authorization').strip("Basic ")
+                    auth = self.headers.getheader('Authorization')[6:]
                     arr = base64.decodestring(auth).split(":", 2)
                     if len(arr) == 2:
                         name = arr[0]
@@ -97,7 +98,7 @@ class pysteveHTTPHandler(handler):
                 return
             else:
                 os.chdir(path)
-                self.path = self.path = "/www/html" + self.path
+                self.path = "/www/htdocs" + self.path
             print(self.path)
             handler.do_GET(self)
             


Reply via email to