package com.lutao.cloud.iot.mqtt.core.server.http.handler;

import org.tio.http.common.HttpRequest;
import org.tio.http.common.HttpResponse;

/**
 * http 过滤器
 *

 */
public interface HttpFilter {

	/**
	 * 处理请求
	 *
	 * @param request HttpRequest
	 * @return 可以为null
	 * @throws Exception Exception
	 */
	boolean filter(HttpRequest request) throws Exception;

	/**
	 * 响应
	 *
	 * @param request  HttpRequest
	 * @param response HttpResponse
	 * @return HttpResponse
	 */
	HttpResponse response(HttpRequest request, HttpResponse response);

}
