org.tinygroup.weblayer.webcontext.basic.interceptor
类 ResponseHeaderSecurityFilter

java.lang.Object
  继承者 org.tinygroup.weblayer.webcontext.basic.interceptor.ResponseHeaderSecurityFilter
所有已实现的接口:
CookieHeaderValueInterceptor, CookieInterceptor, HeaderNameInterceptor, HeaderValueInterceptor, RedirectLocationInterceptor, ResponseHeaderInterceptor, StatusMessageInterceptor, WebContextLifecycleInterceptor

public class ResponseHeaderSecurityFilter
extends Object
implements WebContextLifecycleInterceptor, HeaderNameInterceptor, HeaderValueInterceptor, CookieInterceptor, CookieHeaderValueInterceptor, StatusMessageInterceptor, RedirectLocationInterceptor

过滤header中的crlf,将status message用HTML entities转义,限制cookie的总大小。

作者:
renhui

字段摘要
static org.tinygroup.commons.tools.HumanReadableSize MAX_SET_COOKIE_SIZE_DEFAULT
           
 
构造方法摘要
ResponseHeaderSecurityFilter()
           
ResponseHeaderSecurityFilter(javax.servlet.http.HttpServletRequest request)
           
 
方法摘要
 javax.servlet.http.Cookie checkCookie(javax.servlet.http.Cookie cookie)
          检查cookie。
 String checkCookieHeaderValue(String name, String value, boolean setHeader)
          检查cookie header。
 String checkHeaderName(String name)
          检查header名称。
 String checkHeaderValue(String name, String value)
          检查header的值。
 String checkRedirectLocation(String location)
          检查重定向location。
 String checkStatusMessage(int sc, String msg)
          检查status消息。
 void commit()
           
 void commitHeaders()
           
 org.tinygroup.commons.tools.HumanReadableSize getMaxCookieSize()
           
 void prepare()
           
 void setMaxCookieSize(org.tinygroup.commons.tools.HumanReadableSize maxSetCookieSize)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

MAX_SET_COOKIE_SIZE_DEFAULT

public static final org.tinygroup.commons.tools.HumanReadableSize MAX_SET_COOKIE_SIZE_DEFAULT
构造方法详细信息

ResponseHeaderSecurityFilter

public ResponseHeaderSecurityFilter()

ResponseHeaderSecurityFilter

public ResponseHeaderSecurityFilter(javax.servlet.http.HttpServletRequest request)
方法详细信息

getMaxCookieSize

public org.tinygroup.commons.tools.HumanReadableSize getMaxCookieSize()

setMaxCookieSize

public void setMaxCookieSize(org.tinygroup.commons.tools.HumanReadableSize maxSetCookieSize)

prepare

public void prepare()
指定者:
接口 WebContextLifecycleInterceptor 中的 prepare

commitHeaders

public void commitHeaders()
指定者:
接口 WebContextLifecycleInterceptor 中的 commitHeaders

commit

public void commit()
指定者:
接口 WebContextLifecycleInterceptor 中的 commit

checkHeaderName

public String checkHeaderName(String name)
从接口 HeaderNameInterceptor 复制的描述
检查header名称。

指定者:
接口 HeaderNameInterceptor 中的 checkHeaderName
返回:
返回值表示修改header的名称,返回null则丢弃header。

checkHeaderValue

public String checkHeaderValue(String name,
                               String value)
从接口 HeaderValueInterceptor 复制的描述
检查header的值。

指定者:
接口 HeaderValueInterceptor 中的 checkHeaderValue
返回:
返回值表示修改header的值,返回null则表示拒绝该header的值。

checkCookie

public javax.servlet.http.Cookie checkCookie(javax.servlet.http.Cookie cookie)
从接口 CookieInterceptor 复制的描述
检查cookie。

指定者:
接口 CookieInterceptor 中的 checkCookie
返回:
返回值表示修改cookie,返回null则表示拒绝该cookie。 特别支持 CookieSupport类。

checkCookieHeaderValue

public String checkCookieHeaderValue(String name,
                                     String value,
                                     boolean setHeader)
从接口 CookieHeaderValueInterceptor 复制的描述
检查cookie header。

指定者:
接口 CookieHeaderValueInterceptor 中的 checkCookieHeaderValue
返回:
返回值表示修改header的值,返回null则表示拒绝该cookie。

checkStatusMessage

public String checkStatusMessage(int sc,
                                 String msg)
从接口 StatusMessageInterceptor 复制的描述
检查status消息。

指定者:
接口 StatusMessageInterceptor 中的 checkStatusMessage
返回:
返回值表示修改status消息,返回null则表示不设置status消息。

checkRedirectLocation

public String checkRedirectLocation(String location)
从接口 RedirectLocationInterceptor 复制的描述
检查重定向location。

指定者:
接口 RedirectLocationInterceptor 中的 checkRedirectLocation
返回:
返回值表示修改location,返回null则表示拒绝该location。


Copyright © 2006–2014 开源组织. All rights reserved.