Skip to main content
Version: 3.14.x.x LTS

RequestFlags

RequestFlags support conditions and accept Pragma continue by default.

The RequestFlags are checked just at the beginning of the doFilter method of a filter or service method of a servlet. RequestFlags describe which RequestWrappers are needed for the given filter or servlet.

Syntax

[ALL] [NONE] [+/-GUESS_CONTENTTYPE] [+/-NEEDS_PARAMS][+/-NEEDS_COOKIES][+/-NEEDS_SET_COOKIES] [+/-HAS_RESPONSE_CONDITION] [+/-NEEDS_BUFFERED_BODY][+/-NEEDS_TIME_METER][+/-NEEDS_FORM_MULTIPARTS][+/-NEEDS_SWITCHING_PROTOCOLS][+/-NEEDS_REDIRECT][+/-NEEDS_GWT_PARSING] [+/-PRUNE_ACCEPT_ENCODING] [+/-NEEDS_JSON_PARSING]
  • 'ALL': Is the same as + with all other flags.
  • 'NONE': Is the same as - with all other flags.
  • '+': This means that the filter needs the wrapper(s) to fulfill this flag. For optimization, the wrapper will only be added if it has not yet been added by another filter in this chain.
  • '-': This means that this filter/servlet does not necessarily need those wrappers BUT they will not be removed if another filter has already added it (you can't remove a wrapper which is already in a chain).
  • 'GUESS_CONTENTTYPE': Wrappers needed to guess the content type.
  • 'NEEDS_PARAMS': Wrappers needed to get the parameters from the query or body.
  • 'NEEDS_COOKIES': Wrappers needed to get the cookies from the cookie header.
  • 'NEEDS_SET_COOKIES': Wrappers needed for some filters to be able to access cookies in the "Set-Cookie" headers with a special cookie API.
  • 'HAS_RESPONSE_CONDITION': Wrappers needed if the filter/servlet has to know the response headers via the request attribute bcx.servlet.response.Header.<headername>.
  • 'NEEDS_BUFFERED_BODY': Wrappers needed if the filter/servlet has to access the request body via the request attribute bcx.servlet.request.Body.
  • 'NEEDS_TIME_METER': Wrappers needed to count the time that is spent in the filter itself. An INFO message will be logged if enabled.
  • 'PRUNE_ACCEPT_ENCODING': Modify the Accept-Encoding header to make the backend encode its response in a format that besides the client, the Proxy can also handle. This is needed when a filter wants to read or modify the content of the backend's response. When there are no usable encoding formats, the proxy returns a 406 - Not Acceptable HTTP response. It is recommended to enable this flag when accessing the response body with the LuaFilter.
  • 'NEEDS_JSON_PARSING': Wrappers needed to get the parameters from a JSON body. The request body will only be parsed if the Content-Type header is "application/json". Sometimes a filter modified the incoming body, and one of the upcoming filter/servlets needs the new, parsed values. In this case, you can use the 'RESET_PARAMS' modifier flag to re-parse the incoming request. Requests of mime "application/json" will be parsed. The parameters will be set as follows:
NameValueParsed JSON
name1stringValueo.name1.v=stringValue
name2doubleValueo.name2.d=doubleValue
name3longValueo.name3.l=longValue
name4integerValueo.name4.n=integerValue
name5booleanValueo.name5.b=booleanValue
name6nullo.name6.z=null
arrayo.array.<idx>.<type>=<value>
object{ subname: boolVal, ... }o.object.o.<name>.<type>=<value>

Sample

  • ALL -HAS_RESPONSE_CONDITION Makes sure that all wrappers for all flags are set, except for the HAS_RESPONSE_CONDITION. For the HAS_RESPONSE_CONDITION, we do not care if the wrappers are already added or not.