#NEWLINE# @ app . route ( '/<secret>/<name>' , methods = [ 'GET' ] ) #NEWLINE# def get_blueprint( secret , name ) : #NEWLINE# #INDENT# validate_secret ( secret ) #NEWLINE# validate_name ( name ) #NEWLINE# content_length = backend . head_blueprint ( secret , name ) #NEWLINE# if ( content_length is None ) : #NEWLINE# #INDENT# abort ( 404 ) #NEWLINE# #UNINDENT# if ( browser_pattern . search ( request . environ . get ( 'HTTP_USER_AGENT' , '' ) ) or ( 'html' == request . args . get ( 'format' ) ) ) : #NEWLINE# #INDENT# librato . count ( 'blueprint-io-server.renders' ) #NEWLINE# statsd . increment ( 'blueprint-io-server.renders' ) #NEWLINE# return render_template ( 'blueprint.html' , b = _blueprint ( secret , name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# librato . count ( 'blueprint-io-server.requests.get' ) #NEWLINE# statsd . increment ( 'blueprint-io-server.requests.get' ) #NEWLINE# librato . count ( 'blueprint-io-server.bandwidth.out' , content_length ) #NEWLINE# statsd . update ( 'blueprint-io-server.bandwidth.out' , content_length ) #NEWLINE# return redirect ( backend . url_for_blueprint ( secret , name ) , code = 301 )