qwefgh90 / spring-framework

Spring Framework
http://projects.spring.io/spring-framework
0 stars 0 forks source link

ForwardedHeaderFilter doesn't provide functions of X-Forwarded headers. #1

Open qwefgh90 opened 5 years ago

qwefgh90 commented 5 years ago

https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/filter/ForwardedHeaderFilter.java

qwefgh90 commented 5 years ago

If new functions are provided to sub-type, they will break Dependency Inversion principle. How about adding functions get by overriding HttpServletRequestWrapper? But abstract method like getRemoteAddr() is not designed for original client.

https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/filter/ForwardedHeaderFilter.java

https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpRequest.java

https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/http/server/ServerHttpRequest.java

https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/http/HttpRequest.java

https://github.com/spring-projects/spring-boot/issues/5677