spring-cloud-gateway
spring-cloud-gateway copied to clipboard
Refactor header appending logic for better readability
This PR refactors the logic for adding headers in the appendXForwarded and appendForwarded methods.
Additionally
upon reviewing both the original and refactored code, I noticed that in appendXForwarded, the result of headers.getFirst() is only checked for null.
Wouldn't it be better to use StringUtils.hasText() instead, to ensure not only that the value is non-null but also that it contains text? What do you think about this approach?