Home / File/ HttpHeaderValidationUtilTest.java — netty Source File

HttpHeaderValidationUtilTest.java — netty Source File

Architecture documentation for HttpHeaderValidationUtilTest.java, a java file in the netty codebase.

Entity Profile

Relationship Graph

Source Code

/*
 * Copyright 2022 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.handler.codec.http;

import io.netty.util.AsciiString;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Supplier;
import java.util.stream.Stream;

import static io.netty.handler.codec.http.HttpHeaderValidationUtil.validateToken;
import static io.netty.handler.codec.http.HttpHeaderValidationUtil.validateValidHeaderValue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;

@Execution(ExecutionMode.CONCURRENT) // We have a couple of fairly slow tests here. Better to run them in parallel.
public class HttpHeaderValidationUtilTest {
    @SuppressWarnings("deprecation") // We need to check for deprecated headers as well.
    public static List<Arguments> connectionRelatedHeaders() {
        List<Arguments> list = new ArrayList<Arguments>();

        list.add(header(false, HttpHeaderNames.ACCEPT));
        list.add(header(false, HttpHeaderNames.ACCEPT_CHARSET));
        list.add(header(false, HttpHeaderNames.ACCEPT_ENCODING));
        list.add(header(false, HttpHeaderNames.ACCEPT_LANGUAGE));
        list.add(header(false, HttpHeaderNames.ACCEPT_RANGES));
        list.add(header(false, HttpHeaderNames.ACCEPT_PATCH));
        list.add(header(false, HttpHeaderNames.ACCESS_CONTROL_ALLOW_CREDENTIALS));
        list.add(header(false, HttpHeaderNames.ACCESS_CONTROL_ALLOW_HEADERS));
        list.add(header(false, HttpHeaderNames.ACCESS_CONTROL_ALLOW_METHODS));
        list.add(header(false, HttpHeaderNames.ACCESS_CONTROL_ALLOW_ORIGIN));
        list.add(header(false, HttpHeaderNames.ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK));
        list.add(header(false, HttpHeaderNames.ACCESS_CONTROL_EXPOSE_HEADERS));
        list.add(header(false, HttpHeaderNames.ACCESS_CONTROL_MAX_AGE));
        list.add(header(false, HttpHeaderNames.ACCESS_CONTROL_REQUEST_HEADERS));
// ... (551 more lines)

Domain

Subdomains

Frequently Asked Questions

What does HttpHeaderValidationUtilTest.java do?
HttpHeaderValidationUtilTest.java is a source file in the netty codebase, written in java. It belongs to the Buffer domain, Allocators subdomain.
Where is HttpHeaderValidationUtilTest.java in the architecture?
HttpHeaderValidationUtilTest.java is located at codec-http/src/test/java/io/netty/handler/codec/http/HttpHeaderValidationUtilTest.java (domain: Buffer, subdomain: Allocators, directory: codec-http/src/test/java/io/netty/handler/codec/http).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free