~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/apps/transport.py

Support serving /robots.txt when using apps.transport (serve-branches or bzr serve --http)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from paste import urlparser
30
30
 
31
31
from loggerhead.apps.branch import BranchWSGIApp
32
 
from loggerhead.apps import favicon_app, static_app
 
32
from loggerhead.apps import favicon_app, robots_app, static_app
33
33
from loggerhead.controllers.directory_ui import DirectoryUI
34
34
 
35
35
_bools = {
158
158
            return static_app(environ, start_response)
159
159
        elif environ['PATH_INFO'] == '/favicon.ico':
160
160
            return favicon_app(environ, start_response)
 
161
        elif environ['PATH_INFO'] == '/robots.txt':
 
162
            return robots_app(environ, start_response)
161
163
        else:
162
164
            transport = get_transport_for_thread(self.base)
163
165
            return BranchesFromTransportServer(
182
184
            return static_app(environ, start_response)
183
185
        elif path_info == '/favicon.ico':
184
186
            return favicon_app(environ, start_response)
 
187
        elif environ['PATH_INFO'] == '/robots.txt':
 
188
            return robots_app(environ, start_response)
185
189
        else:
186
190
            transport = get_transport_for_thread(self.base)
187
191
            # segments starting with ~ are user branches