Skip to content
New issue

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

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

Already on GitHub? Sign in 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 <[email protected]>
…d and appendForwarded methods

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

Signed-off-by: Hyeon Sung <[email protected]>
add import

Signed-off-by: Hyeon Sung <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants