~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

Fix loggerhead to not be so totally unicode-naive.
As a bonus, fix the content-disposition for files with spaces in their names.
Thanks to Jean-Francois Roy for prods and sanity checks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from optparse import OptionParser
23
23
 
24
 
from bzrlib.plugin import load_plugins
25
 
 
26
24
from paste import httpserver
27
25
from paste.httpexceptions import HTTPExceptionHandler, HTTPInternalServerError
28
26
from paste.translogger import TransLogger
127
125
        prefix = '/'
128
126
    else:
129
127
        prefix = options.user_prefix
130
 
        if not prefix.startswith('/'):
131
 
            prefix = '/' + prefix
132
128
 
133
129
    try:
134
130
        from paste.deploy.config import PrefixMiddleware
148
144
    else:
149
145
        app = PrefixMiddleware(app, prefix=prefix)
150
146
 
 
147
    app = ErrorHandlerApp(app)
151
148
    app = HTTPExceptionHandler(app)
152
 
    app = ErrorHandlerApp(app)
153
149
 
154
150
    if not options.user_port:
155
151
        port = '8080'
161
157
    else:
162
158
        host = options.user_host
163
159
 
164
 
    load_plugins()
165
 
 
166
160
    httpserver.serve(app, host=host, port=port)
167
161
 
168
162