MessageBytes is normalized, converted and valid. It
also makes sure there is no security hole. Mainly, this class can be used by doing:
HttpRequestURIDecoder.decode(decodedURI, urlDecoder, encoding, b2cConverter);
| Modifier and Type | Field and Description |
|---|---|
| protected static final boolean | |
| private static final boolean | |
| private static final Logger | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: true if the uriCC represents a normalized URI, or false otherwiseURI to be checked (should be chars) uriCC)Check that the URI is normalized following character decoding. |
| protected void | |
| public static void | convertToChars(final DataChunk
- The bytes to decode decodedURI, Charset the encoding value, default is UTF-8. encoding)Converts the normalized the HTTP request represented by the bytes inside |
| private static void | convertURI(final MessageBytes
- The bytes to decode uri, final String the encoding value encoding, B2CConverter the Bytes to Char Converter. b2cConverter)Convert a URI using the specified encoding, using the specified [@link B2CConverter} to decode the request. |
| protected static void | |
| private static void | |
| public static void | decode(final MessageBytes
- The bytes to decode decodedURI, final UDecoder - The urlDecoder to use to decode. urlDecoder)Decode the http request represented by the bytes inside |
| public static void | decode(final MessageBytes
- The bytes to decode decodedURI, final UDecoder - The urlDecoder to use to decode. urlDecoder, String the encoding value, default is UTF-8. encoding, final B2CConverter the Bytes to Char Converter. b2cConverter)Decode the HTTP request represented by the bytes inside |
| public static void | |
| public static void | |
| public static void | |
| public static void | decode(final DataChunk
- The bytes to decode originalURI, final DataChunk the target targetDecodedURI, final boolean DataChunk URI will be decoded tois '/' an allowable character isSlashAllowed, final Charset the encoding value, default is UTF-8 encoding)Decode the HTTP request represented by the bytes inside |
| protected void | |
| protected void | |
| public static boolean | Returns: true if normalization was successful, or false otherwiseURI to be normalized uriMB)Normalize URI. |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean |
| ALLOW_BACKSLASH | back to summary |
|---|---|
| protected static final boolean ALLOW_BACKSLASH | |
| COLLAPSE_ADJACENT_SLASHES | back to summary |
|---|---|
| private static final boolean COLLAPSE_ADJACENT_SLASHES | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| STATE_CHAR | back to summary |
|---|---|
| private static final int STATE_CHAR | |
| STATE_PERCENT | back to summary |
|---|---|
| private static final int STATE_PERCENT | |
| STATE_SLASH | back to summary |
|---|---|
| private static final int STATE_SLASH | |
| STATE_SLASHDOT | back to summary |
|---|---|
| private static final int STATE_SLASHDOT | |
| STATE_SLASHDOTDOT | back to summary |
|---|---|
| private static final int STATE_SLASHDOTDOT | |
| HttpRequestURIDecoder | back to summary |
|---|---|
| public HttpRequestURIDecoder() | |
| checkNormalize | back to summary |
|---|---|
| public static boolean checkNormalize(final CharChunk uriCC) Check that the URI is normalized following character decoding. This method checks for "\", 0, "//", "/./" and "/../". This method will return false if sequences that are supposed to be normalized are still present in the URI.
| |
| convertMB | back to summary |
|---|---|
| protected void convertMB(MessageBytes mb) Character conversion of the a US-ASCII MessageBytes. | |
| convertToChars | back to summary |
|---|---|
| public static void convertToChars(final DataChunk decodedURI, Charset encoding) throws CharConversionException Converts the normalized the HTTP request represented by the bytes inside | |
| convertURI | back to summary |
|---|---|
| private static void convertURI(final MessageBytes uri, final String encoding, B2CConverter b2cConverter) throws Exception Convert a URI using the specified encoding, using the specified [@link B2CConverter} to decode the request.
| |
| copyBytes | back to summary |
|---|---|
| protected static void copyBytes(byte[] b, int dest, int src, int len) Copy an array of bytes to a different position. Used during normalization. | |
| copyChars | back to summary |
|---|---|
| private static void copyChars(char[] c, int dest, int src, int len) Copy an array of chars to a different position. Used during normalization. | |
| decode | back to summary |
|---|---|
| public static void decode(final MessageBytes decodedURI, final UDecoder urlDecoder) throws Exception Decode the http request represented by the bytes inside
| |
| decode | back to summary |
|---|---|
| public static void decode(final MessageBytes decodedURI, final UDecoder urlDecoder, String encoding, final B2CConverter b2cConverter) throws Exception Decode the HTTP request represented by the bytes inside
| |
| decode | back to summary |
|---|---|
| public static void decode(final DataChunk decodedURI) throws CharConversionException Decode the HTTP request represented by the bytes inside
| |
| decode | back to summary |
|---|---|
| public static void decode(final DataChunk decodedURI, final boolean isSlashAllowed) throws CharConversionException Decode the HTTP request represented by the bytes inside
| |
| decode | back to summary |
|---|---|
| public static void decode(final DataChunk decodedURI, final boolean isSlashAllowed, final Charset encoding) throws CharConversionException Decode the HTTP request represented by the bytes inside | |
| decode | back to summary |
|---|---|
| public static void decode(final DataChunk originalURI, final DataChunk targetDecodedURI, final boolean isSlashAllowed, final Charset encoding) throws CharConversionException Decode the HTTP request represented by the bytes inside | |
| log | back to summary |
|---|---|
| protected void log(String message) Log a message on the Logger associated with our Container (if any)
| |
| log | back to summary |
|---|---|
| protected void log(String message, Throwable throwable) Log a message on the Logger associated with our Container (if any) | |
| normalize | back to summary |
|---|---|
| public static boolean normalize(MessageBytes uriMB) Normalize URI. This method normalizes "\", "//", "/./" and "/../". This method will return false when trying to go above the root, or if the URI contains a null byte.
| |
| normalize | back to summary |
|---|---|
| public static boolean normalize(final DataChunk dataChunk) Normalize URI. This method normalizes "\", "//", "/./" and "/../". This method will return false when trying to go above the root, or if the URI contains a null byte.
| |
| normalizeBuffer | back to summary |
|---|---|
| public static boolean normalizeBuffer(final BufferChunk bc) | |
| normalizeBytes | back to summary |
|---|---|
| public static boolean normalizeBytes(final ByteChunk bc) | |
| normalizeChars | back to summary |
|---|---|
| public static boolean normalizeChars(final CharChunk uriCC) | |