~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to start-loggerhead.py

MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
import logging
4
4
import logging.handlers
 
5
from optparse import OptionParser
5
6
import os
6
7
import sys
7
 
from optparse import OptionParser
 
8
import urlparse
8
9
 
9
10
from configobj import ConfigObj
10
11
 
121
122
    app = make_filter(app, None)
122
123
 
123
124
    if webpath:
124
 
        if not webpath.endswith('/'):
125
 
            webpath += '/'
126
 
        def app(environ, start_response, app=app):
127
 
            environ['SCRIPT_NAME'] = webpath
128
 
            return app(environ, start_response)
 
125
        scheme, netloc, path, blah, blah, blah = urlparse.urlparse(webpath)
 
126
        def app(environ, start_response, orig=app):
 
127
            environ['SCRIPT_NAME'] = path
 
128
            environ['HTTP_HOST'] = netloc
 
129
            return orig(environ, start_response)
129
130
 
130
131
    try:
131
132
        httpserver.serve(