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

NIFI-6920 Add empty string key check for HTTP response headers before… #4517

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ private Map<String, String> convertAttributesFromHeaders(URL url, Response respo
// create a new hashmap to store the values from the connection
Map<String, String> map = new HashMap<>();
responseHttp.headers().names().forEach((key) -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would want to use StringUtils.isBlank() see other parts of the code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had used the logic in org.apache.nifi.flowfile.FlowFile.KeyValidator.isValid(String) as a guideline, but I agree that this is a more appropriate solution.

if (key == null) {
if (StringUtils.isBlank(key)) {
return;
}

Expand Down