Skip to content

Commit

Permalink
Change variable names in addCookies function
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharuja committed Jan 22, 2020
1 parent 4c83b4c commit 92129a0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions stdlib/http/src/main/ballerina/src/http/http_request.bal
Original file line number Diff line number Diff line change
Expand Up @@ -538,14 +538,12 @@ public type Request object {
# + cookiesToAdd - Represents the cookies to be added
public function addCookies(Cookie[] cookiesToAdd) {
string cookieheader = "";
string? temp1 = ();
string? temp2 = ();
Cookie[] sortedCookies = cookiesToAdd.sort(comparator);
foreach var cookie in sortedCookies {
temp1 = cookie.name;
temp2 = cookie.value;
if (temp1 is string && temp2 is string) {
cookieheader = cookieheader + temp1 + EQUALS + temp2 + SEMICOLON + SPACE;
var cookieName = cookie.name;
var cookieValue = cookie.value;
if (cookieName is string && cookieValue is string) {
cookieheader = cookieheader + cookieName + EQUALS + cookieValue + SEMICOLON + SPACE;
}
cookie.lastAccessedTime = time:currentTime();
}
Expand Down

0 comments on commit 92129a0

Please sign in to comment.