| Modifier and Type | Method and Description |
|---|---|
static String |
decodeId(String token)
Decodes a percent-encoded token to a raw protocol ID using UTF-8.
|
static String |
encodeId(String id)
Encodes a single raw protocol ID to canonical token form using the HTTP token codec
from core, which keeps RFC 7230
tchar octets literal and percent-encodes the
rest (including '%') with uppercase hexadecimal. |
static Header |
formatValue(List<String> protocolIds)
Formats a list of raw ALPN protocol IDs into a single
ALPN header. |
static List<String> |
parseValue(Header header)
Parses an
ALPN header into decoded protocol IDs. |
public static Header formatValue(List<String> protocolIds)
ALPN header.public static List<String> parseValue(Header header) throws ProtocolException
ALPN header into decoded protocol IDs.ProtocolException - if a token is not a well-formed percent-encoded protocol ID.public static String encodeId(String id)
tchar octets literal and percent-encodes the
rest (including '%') with uppercase hexadecimal.public static String decodeId(String token) throws ProtocolException
A '%' that is not followed by two hexadecimal digits is a malformed
token and is rejected as a protocol error.
ProtocolException - if the token contains malformed percent-encoding.Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.