11697Smax.romanov@nginx.comdef application(scope, receive=None, send=None): 21697Smax.romanov@nginx.com assert scope['type'] == 'http' 31697Smax.romanov@nginx.com 4*2616Szelenkov@nginx.com if receive is None and send is None: 51697Smax.romanov@nginx.com return app_http 61697Smax.romanov@nginx.com 7*2616Szelenkov@nginx.com return app_http(receive, send) 81697Smax.romanov@nginx.com 91848Szelenkov@nginx.com 101697Smax.romanov@nginx.comasync def app_http(receive, send): 111848Szelenkov@nginx.com await send( 121848Szelenkov@nginx.com { 131848Szelenkov@nginx.com 'type': 'http.response.start', 141848Szelenkov@nginx.com 'status': 200, 15*2616Szelenkov@nginx.com 'headers': [ 16*2616Szelenkov@nginx.com (b'content-length', b'0'), 17*2616Szelenkov@nginx.com ], 181848Szelenkov@nginx.com } 191848Szelenkov@nginx.com ) 20