Skip to content

Commit

Permalink
Update with string templates
Browse files Browse the repository at this point in the history
  • Loading branch information
TharmiganK committed Jul 24, 2024
1 parent 429ace4 commit 05c24e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ballerina/caching_request_cache_control.bal
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,20 @@ public class RequestCacheControl {
}

if self.maxAge >= 0d {
directives[i] = MAX_AGE + "=" + decimal:floor(self.maxAge).toString();
directives[i] = string `${MAX_AGE}=${decimal:floor(self.maxAge)}`;
i += 1;
}

if self.maxStale == MAX_STALE_ANY_AGE {
directives[i] = MAX_STALE;
i += 1;
} else if self.maxStale >= 0d {
directives[i] = MAX_STALE + "=" + decimal:floor(self.maxStale).toString();
directives[i] = string `${MAX_STALE}=${decimal:floor(self.maxStale)}`;
i += 1;
}

if self.minFresh >= 0d {
directives[i] = MIN_FRESH + "=" + decimal:floor(self.minFresh).toString();
directives[i] = string `${MIN_FRESH}=${decimal:floor(self.minFresh)}`;
i += 1;
}

Expand Down
4 changes: 2 additions & 2 deletions ballerina/caching_response_cache_control.bal
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ public class ResponseCacheControl {
}

if self.maxAge >= 0d {
directives[i] = MAX_AGE + "=" + decimal:floor(self.maxAge).toString();
directives[i] = string `${MAX_AGE}=${decimal:floor(self.maxAge)}`;
i += 1;
}

if self.sMaxAge >= 0d {
directives[i] = S_MAX_AGE + "=" + decimal:floor(self.sMaxAge).toString();
directives[i] = string `${S_MAX_AGE}=${decimal:floor(self.sMaxAge)}`;
i += 1;
}

Expand Down

0 comments on commit 05c24e6

Please sign in to comment.