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

fix: 1335 #1343

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Stack;

/**
* The connect task which used for connect to the backend.
Expand Down Expand Up @@ -116,18 +117,32 @@ private void addUserRequiredHeader(FileDownloadConnection connection) {
String name;
List<String> list;

Stack<String> names = new Stack<>();
Stack<List<String>> lists = new Stack<>();

// add addition headers which is provided by the user
Set<Map.Entry<String, List<String>>> entries = additionHeaders.entrySet();
for (Map.Entry<String, List<String>> e : entries) {
name = e.getKey();
list = e.getValue();
names.push(name);
lists.push(list);
/*if (list != null) {
for (String value : list) {
connection.addHeader(name, value);
}
}*/
}

while (lists.size() > 0) {
list = lists.pop();
name = names.pop();
if (list != null) {
for (String value : list) {
connection.addHeader(name, value);
}
}
}

}
}
}
Expand Down