Skip to content
Open
Show file tree
Hide file tree
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 @@ -148,8 +148,8 @@ private void doRequest(RequestWay way, String url, Map<String, Object> urlMap, O
//construct url
if ( null != urlMap ){
requestUrl += "?";
for ( String key : urlMap.keySet() ) {
requestUrl = requestUrl + key + "=" + urlMap.get(key) + "&";
for (Map.Entry<String, Object> entry : urlMap.entrySet()) {
requestUrl = requestUrl + entry.getKey() + "=" + entry.getValue() + "&";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ private List<HttpCookie> getValidCookies(URI uri) {
List<HttpCookie> targetCookies = new ArrayList<HttpCookie>();
// If the stored URI does not have a path then it must match any URI in
// the same domain
for (URI storedUri : allCookies.keySet()) {
for (Map.Entry<URI, Set<HttpCookie>> entry : allCookies.entrySet()) {
// Check ith the domains match according to RFC 6265
if (checkDomainsMatch(storedUri.getHost(), uri.getHost())) {
if (checkDomainsMatch(entry.getKey().getHost(), uri.getHost())) {
// Check if the paths match according to RFC 6265
if (checkPathsMatch(storedUri.getPath(), uri.getPath())) {
targetCookies.addAll(allCookies.get(storedUri));
if (checkPathsMatch(entry.getKey().getPath(), uri.getPath())) {
targetCookies.addAll(entry.getValue());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ public HttpClientStack(HttpClient client) {
}

private static void addHeaders(HttpUriRequest httpRequest, Map<String, String> headers) {
for (String key : headers.keySet()) {
httpRequest.setHeader(key, headers.get(key));
for (Map.Entry<String, String> entry : headers.entrySet()) {
httpRequest.setHeader(entry.getKey(), entry.getValue());
}
}

@SuppressWarnings("unused")
private static List<NameValuePair> getPostParameterPairs(Map<String, String> postParams) {
List<NameValuePair> result = new ArrayList<NameValuePair>(postParams.size());
for (String key : postParams.keySet()) {
result.add(new BasicNameValuePair(key, postParams.get(key)));
for (Map.Entry<String, String> entry : postParams.entrySet()) {
result.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ public HttpResponse performRequest(Request<?> request, Map<String, String> addit
}
URL parsedUrl = new URL(url);
HttpURLConnection connection = openConnection(parsedUrl, request);
for (String headerName : map.keySet()) {
connection.addRequestProperty(headerName, map.get(headerName));
for (Entry<String, String> entry : map.entrySet()) {
connection.addRequestProperty(entry.getKey(), entry.getValue());
}
setConnectionParametersForRequest(connection, request);
// Initialize HttpResponse with data from the HttpURLConnection.
Expand Down