Package io.netty.handler.codec.http
Class QueryStringDecoder.Builder
java.lang.Object
io.netty.handler.codec.http.QueryStringDecoder.Builder
- Enclosing class:
QueryStringDecoder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Charset
private boolean
private boolean
private int
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a decoder that will lazily decode the given URI with the settings configured in this builder.Create a decoder that will lazily decode the given URI with the settings configured in this builder.The charset to use for decoding percent escape sequences.hasPath
(boolean hasPath) true
by default.htmlQueryDecoding
(boolean htmlQueryDecoding) RFC 3986 (the URI standard) makes no mention of using '+' to encode a space in a URI query component.maxParams
(int maxParams) Maximum number of query parameters allowed, to mitigate HashDOS.semicolonIsNormalChar
(boolean semicolonIsNormalChar) false
by default.
-
Field Details
-
hasPath
private boolean hasPath -
maxParams
private int maxParams -
semicolonIsNormalChar
private boolean semicolonIsNormalChar -
charset
-
htmlQueryDecoding
private boolean htmlQueryDecoding
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
hasPath
true
by default. When set tofalse
, the input string only contains the query component of the URI.- Parameters:
hasPath
- Whether the URI contains a path- Returns:
- This builder
-
maxParams
Maximum number of query parameters allowed, to mitigate HashDOS. 1024 by default.- Parameters:
maxParams
- The maximum number of query parameters- Returns:
- This builder
-
semicolonIsNormalChar
false
by default. If set totrue
, instead of allowing query parameters to be separated by semicolons, treat the semicolon as a normal character in a query value.- Parameters:
semicolonIsNormalChar
- Whether to treat semicolons as a normal character- Returns:
- This builder
-
charset
The charset to use for decoding percent escape sequences.HttpConstants.DEFAULT_CHARSET
by default.- Parameters:
charset
- The charset- Returns:
- This builder
-
htmlQueryDecoding
RFC 3986 (the URI standard) makes no mention of using '+' to encode a space in a URI query component. The whatwg HTML standard, however, defines the query to be encoded with theapplication/x-www-form-urlencoded
serializer defined in the whatwg URL standard, which does use '+' to encode a space instead of%20
.This flag controls whether the decoding should happen according to HTML rules, which decodes the '+' to a space. The default is
true
.- Parameters:
htmlQueryDecoding
- Whether to decode '+' to space- Returns:
- This builder
-
build
Create a decoder that will lazily decode the given URI with the settings configured in this builder.- Parameters:
uri
- The URI in String form- Returns:
- The decoder
-
build
Create a decoder that will lazily decode the given URI with the settings configured in this builder. Note thathasPath(boolean)
has no effect when using this method.- Parameters:
uri
- The already parsed URI- Returns:
- The decoder
-