Send response to client and fire after filter chain if any.
516582
function(isGlobal, server, err, msg, session, resp, opts, cb) {
  if(isGlobal) {
    cb(err, resp, opts);
    // after filter should not interfere response
    afterFilter(isGlobal, server, err, msg, session, resp, opts, cb);
  } else {
    afterFilter(isGlobal, server, err, msg, session, resp, opts, cb);
  }
}
747233
def handle_response(self, msgtype, msgid, response):
        """"""
        self._proxy.response(msgid, response)
1098656
function() {
		if(!_self.waitingForResponse && _self.queue.length) {
			_self.waitingForResponse = true;
			var cmd = _self.queue.shift();

			if(_self.conn) {
				_self.conn.removeAllListeners('data');
				_self.conn.addListener('data', function(data) {
					Debug.log('response:');
					Debug.log(data);
					cmd.responseHandler.call(cmd, data);
				});
			}
			Debug.log('request:');
			Debug.log(cmd.command());
			process.nextTick(function() {
				_self.conn.write(cmd.command());
			});
		}
	}
1258933
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
		
		HttpServletResponse res = (HttpServletResponse)response;
		HttpServletRequest req = (HttpServletRequest)request;
		
		String et = req.getParameter("e");
		String h = req.getParameter("h");
		
		if(null == et || null == h) {
			badRequest(res);
			LOG.warn("et & h attributes are null; Bad request from IP: " + req.getRemoteAddr());
			return;
		}
			
		String baseUrl = req.getRequestURI();
		String passKey = secureUriMapper.getPassKey(baseUrl);		
		
		String salt = passKey + baseUrl + "?e=" + et;
		String hash = SpringExtensionsUtil.getMD5(salt);		
		if(!hash.trim().equals(h)) {
			badRequest(res);
			LOG.warn("Hash Value doesn't match; Bad request from IP: " + req.getRemoteAddr());
			return;
		}
		
		long expiryTime = Long.parseLong(et);		
		if(expiryTime > 0 && !(new Date().getTime() <= expiryTime)) {
			badRequest(res);
			LOG.warn("Secure Link expried, link accessed from IP: " + req.getRemoteAddr());
			return;
		}		
		
		/** making chain call for following filters*/
		chain.doFilter(request, response);
	}
406152
function sendResponse (req, res, next, dataStore) {
  return function (err, resource) {
    if (!err) {
      util.debug("%s successfully created/edited/deleted", resource.toString());
      res.swagger.lastModified = resource.modifiedOn;
    }

    // Set the response body (unless it's already been set by other middleware)
    if (err || res.body) {
      next(err);
    }
    else if (res.swagger.isCollection) {
      // Response body is the entire collection
      dataStore.getCollection(resource.collection, (err, collection) => {
        res.body = _.map(collection, "data");
        next(err);
      });
    }
    else {
      // Response body is the resource that was created/update/deleted
      res.body = resource.data;
      next();
    }
  };
}
441952
async def handler(event):
    """"""
    query = urllib.parse.quote(event.pattern_match.group(1))
    await asyncio.wait([
        event.delete(),
        event.respond(SEARCH.format(query), reply_to=event.reply_to_msg_id)
    ])
217653
public void onAsyncResponse(ConsumerConfig config, SofaRequest request, SofaResponse response, Throwable throwable)
        throws SofaRpcException {
        try {
            for (Filter loadedFilter : loadedFilters) {
                loadedFilter.onAsyncResponse(config, request, response, throwable);
            }
        } catch (SofaRpcException e) {
            LOGGER
                .errorWithApp(config.getAppName(), "Catch exception when do filtering after asynchronous respond.", e);
        }
    }
620686
@Override
    public void doFilter(RenderRequest request, RenderResponse response, FilterChain chain) throws IOException,
            PortletException {
        doCommonFilter(request, response, chain);
    }
994988
public function onResponseLate(FilterResponseEvent $event)
    {
        if (!$this->eventRequestMatches($event)) {
            return;
        }
        $this->responseTransformer->transformLate($event->getRequest(), $event->getResponse());
    }
295091
def handleResponse(self, data):
        """"""

        self.factory.response_xml = data

        if self.status == '200':
            self.factory.parseErrorAndResponse(data)

        self.factory.deferred = None
        self.transport.loseConnection()
1042532
def handle_response(self, item_session: ItemSession) -> Actions:
        '''
        '''
        action = self.consult_response_hook(item_session)

        if action == Actions.RETRY:
            item_session.set_status(Status.error)
        elif action == Actions.FINISH:
            item_session.set_status(Status.done)
        elif action == Actions.STOP:
            raise HookStop('Script requested immediate stop.')

        return action
719202
@Override
    public void doFilter(EventRequest request, EventResponse response, FilterChain chain) throws IOException,
            PortletException {
        doCommonFilter(request, response, chain);
    }
115735
@Override
    public final void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain chain) throws IOException, ServletException {
        if (ProcessingPosition.PRE == this.processingPosition || ProcessingPosition.BOTH == this.processingPosition) {
            this.doProcessing(servletRequest);
        }

        chain.doFilter(servletRequest, servletResponse);

        if (ProcessingPosition.POST == this.processingPosition || ProcessingPosition.BOTH == this.processingPosition) {
            this.doProcessing(servletRequest);
        }
    }
993889
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
		HttpServletRequest hreq = (HttpServletRequest)request;
		HttpServletResponse hresp = (HttpServletResponse)response;
		String perm = aaf_type+hreq.getPathInfo()+'|'+hreq.getMethod();
		if(hreq.isUserInRole(perm)) {
			chain.doFilter(request, response);
		} else {
			log.audit("PathFilter has denied",hreq.getUserPrincipal().getName(),"access to",perm);
			hresp.sendError(403,not_authorized_msg);
		}
	}
285830
async def send(self, *args, **kwargs):
        """"""
        for callback in self:
            res = callback(*args, **kwargs)
            if asyncio.iscoroutine(res) or isinstance(res, asyncio.Future):
                await res
1229096
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
		try {
			HttpServletRequest hreq = (HttpServletRequest)request;
			if(noAuthn(hreq)) {
				chain.doFilter(request, response);
			} else {
				HttpServletResponse hresp = (HttpServletResponse)response;
				TafResp tresp = httpChecker.validate(hreq, hresp);
				if(tresp.isAuthenticated()==RESP.IS_AUTHENTICATED) {
						CadiWrap cw = new CadiWrap(hreq, tresp, httpChecker.getLur(),getConverter(hreq));
						if(httpChecker.notCadi(cw, hresp)) {
							chain.doFilter(cw,response);
						}
				}						
			}
		} catch (ClassCastException e) {
			throw new ServletException("CadiFilter expects Servlet to be an HTTP Servlet",e);
		}
	}
1099580
@Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
            ServletException {
        
        if(response instanceof HttpServletResponse) {
            HttpServletResponse httpResponse = (HttpServletResponse) response;
            String queryString = ((HttpServletRequest) request).getQueryString();
            if(queryString == null) {
                queryString = "";
            }
            if(regExpFilters == null || regExpFilters.isEmpty()) {
                setHeaders(httpResponse);
            } else {       
                if(Pattern.matches(regExpFilters, queryString)) {
                    setHeaders(httpResponse);
                }
            }
                   
        }
        chain.doFilter(request, response);
        
    }