Java Code Examples for com.linecorp.armeria.common.HttpHeaderNames#of()

The following examples show how to use com.linecorp.armeria.common.HttpHeaderNames#of() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ThrottlingHeadersImpl.java    From armeria with Apache License 2.0 4 votes vote down vote up
ThrottlingHeadersImpl(final String scheme) {
    limitHeader = HttpHeaderNames.of(scheme + LIMIT_SUFFIX);
    remainingHeader = HttpHeaderNames.of(scheme + REMAINING_SUFFIX);
    resetHeader = HttpHeaderNames.of(scheme + RESET_SUFFIX);
}
 
Example 2
Source File: RoutingPredicate.java    From armeria with Apache License 2.0 4 votes vote down vote up
static RoutingPredicate<HttpHeaders> ofHeaders(CharSequence headerName,
                                               Predicate<? super String> valuePredicate) {
    final AsciiString name = HttpHeaderNames.of(headerName);
    return new RoutingPredicate<>(headerName, headers ->
            headers.getAll(name).stream().anyMatch(valuePredicate));
}
 
Example 3
Source File: ClientAddressSource.java    From armeria with Apache License 2.0 4 votes vote down vote up
/**
 * Returns a {@link ClientAddressSource} which indicates the value of the specified {@code header}
 * in a request will be used to determine a client address.
 */
public static ClientAddressSource ofHeader(CharSequence header) {
    checkArgument(requireNonNull(header, "header").length() > 0, "empty header");
    return new ClientAddressSource(HttpHeaderNames.of(header));
}
 
Example 4
Source File: OAuth2TokenExtractor.java    From armeria with Apache License 2.0 4 votes vote down vote up
OAuth2TokenExtractor(CharSequence header) {
    this.header = HttpHeaderNames.of(header);
}
 
Example 5
Source File: OAuth1aTokenExtractor.java    From armeria with Apache License 2.0 4 votes vote down vote up
OAuth1aTokenExtractor(CharSequence header) {
    this.header = HttpHeaderNames.of(header);
}
 
Example 6
Source File: BasicTokenExtractor.java    From armeria with Apache License 2.0 4 votes vote down vote up
BasicTokenExtractor(CharSequence header) {
    this.header = HttpHeaderNames.of(header);
}
 
Example 7
Source File: RequestContextExporterBuilder.java    From armeria with Apache License 2.0 4 votes vote down vote up
private static AsciiString toHeaderName(CharSequence name) {
    return HttpHeaderNames.of(requireNonNull(name, "name").toString());
}