Commit 0b925e5a by Spencer Gibb

Merge pull request #409 from brandon-atkinson/issue-394-remove-deflate

* issue-394-remove-deflate: Removed deflate accept-encoding from outbound requests
parents 58284a45 80206e6b
...@@ -93,7 +93,7 @@ public class ProxyRequestHelper { ...@@ -93,7 +93,7 @@ public class ProxyRequestHelper {
for (String header : zuulRequestHeaders.keySet()) { for (String header : zuulRequestHeaders.keySet()) {
headers.set(header, zuulRequestHeaders.get(header)); headers.set(header, zuulRequestHeaders.get(header));
} }
headers.set("accept-encoding", "deflate, gzip"); headers.set("accept-encoding", "gzip");
return headers; return headers;
} }
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
package org.springframework.cloud.netflix.zuul.filters; package org.springframework.cloud.netflix.zuul.filters;
import java.util.List;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.mockito.Mock; import org.mockito.Mock;
...@@ -25,8 +23,10 @@ import org.springframework.boot.actuate.trace.TraceRepository; ...@@ -25,8 +23,10 @@ import org.springframework.boot.actuate.trace.TraceRepository;
import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import static org.junit.Assert.*; import java.util.List;
import static org.hamcrest.Matchers.*; import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import static org.mockito.MockitoAnnotations.initMocks; import static org.mockito.MockitoAnnotations.initMocks;
/** /**
...@@ -65,4 +65,19 @@ public class ProxyRequestHelperTests { ...@@ -65,4 +65,19 @@ public class ProxyRequestHelperTests {
assertThat(missingName, is(nullValue())); 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