Commit 80206e6b by Brandon Atkinson Committed by Spencer Gibb

Removed deflate accept-encoding from outbound requests

parent 58284a45
......@@ -93,7 +93,7 @@ public class ProxyRequestHelper {
for (String header : zuulRequestHeaders.keySet()) {
headers.set(header, zuulRequestHeaders.get(header));
}
headers.set("accept-encoding", "deflate, gzip");
headers.set("accept-encoding", "gzip");
return headers;
}
......
......@@ -16,8 +16,6 @@
package org.springframework.cloud.netflix.zuul.filters;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
......@@ -25,8 +23,10 @@ import org.springframework.boot.actuate.trace.TraceRepository;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.util.MultiValueMap;
import static org.junit.Assert.*;
import java.util.List;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import static org.mockito.MockitoAnnotations.initMocks;
/**
......@@ -65,4 +65,19 @@ public class ProxyRequestHelperTests {
assertThat(missingName, is(nullValue()));
}
@Test
public void buildZuulRequestHeadersRequestsGzipAndOnlyGzip() {
MockHttpServletRequest request = new MockHttpServletRequest("", "/");
ProxyRequestHelper helper = new ProxyRequestHelper();
MultiValueMap<String, String> headers = helper.buildZuulRequestHeaders(request);
List<String> acceptEncodings = headers.get("accept-encoding");
assertThat(acceptEncodings, hasSize(1));
assertThat(acceptEncodings, contains("gzip"));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment