blob: 4c5ac0b317104858740324dafd5d4880c6c261aa [file] [log] [blame]
/*
* Copyright (C) 2011, Google Inc. and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0 which is available at
* https://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
package org.eclipse.jgit.http.server;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class ServletUtilsTest {
@Test
public void testAcceptGzip() {
assertFalse(ServletUtils.acceptsGzipEncoding((String) null));
assertFalse(ServletUtils.acceptsGzipEncoding(""));
assertTrue(ServletUtils.acceptsGzipEncoding("gzip"));
assertTrue(ServletUtils.acceptsGzipEncoding("deflate,gzip"));
assertTrue(ServletUtils.acceptsGzipEncoding("gzip,deflate"));
assertFalse(ServletUtils.acceptsGzipEncoding("gzip(proxy)"));
assertFalse(ServletUtils.acceptsGzipEncoding("proxy-gzip"));
}
}