spring-cloud-netflix: Zuul removes content-length for all clients, it is not a hop-by-hop header

In the method isIncludedHeader of ProxyRequestHelper, the code will not pass some headers, any reason to do this?

`

public boolean isIncludedHeader(String headerName) {
	String name = headerName.toLowerCase();
	RequestContext ctx = RequestContext.getCurrentContext();
	if (ctx.containsKey(IGNORED_HEADERS)) {
		Object object = ctx.get(IGNORED_HEADERS);
		if (object instanceof Collection && ((Collection<?>) object).contains(name)) {
			return false;
		}
	}
	switch (name) {   //these header will not be passed to the downstream server.
	case "host":
	case "connection":
	case "content-length":
	case "content-encoding":
	case "server":
	case "transfer-encoding":
	case "x-application-context":
		return false;
	default:
		return true;
	}
}

`

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments