Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor header appending logic for better readability #3676

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dukbong
Copy link
Contributor

@dukbong dukbong commented Jan 22, 2025

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?

This PR refactors the logic for adding headers in the appendXForwarded and appendForwarded methods.

Signed-off-by: Hyeon Sung <gorae930301@gmail.com>
…d and appendForwarded methods

This PR refactors the logic for adding headers in the appendXForwarded and appendForwarded methods.

Signed-off-by: Hyeon Sung <gorae930301@gmail.com>
add import

Signed-off-by: Hyeon Sung <gorae930301@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants