Skip to content
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