com.blade.mvc.hook.Signature.request()

Here are the examples of the java api com.blade.mvc.hook.Signature.request() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

15 Source : BaseWebHook.java
with MIT License
from tfssweb

@Override
public boolean before(Signature signature) {
    Request request = signature.request();
    Response response = signature.response();
    String uri = request.uri();
    String ip = request.address();
    // 禁止该ip访问
    if (TaleConst.BLOCK_IPS.contains(ip)) {
        response.text("You have been banned, brother");
        return false;
    }
    log.info("UserAgent: {}", request.userAgent());
    log.info("用户访问地址: {}, 来路地址: {}", uri, ip);
    if (uri.startsWith(TaleConst.STATIC_URI)) {
        return true;
    }
    if (!TaleConst.INSTALLED && !uri.startsWith(TaleConst.INSTALL_URI)) {
        response.redirect(TaleConst.INSTALL_URI);
        return false;
    }
    if (TaleConst.INSTALLED) {
        return isRedirect(request, response);
    }
    return true;
}