Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
koji-1009 committed Dec 21, 2023
1 parent eff0b7e commit 7f04df1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/src/loader/network_loader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ class NetworkLoader {
final contentType = response.headers['content-type'] ?? '';
DateTime? expireAt;
if (checkMaxAgeIfExist) {
final cacheControl = response.headers['cache-control']?.toLowerCase() ?? '';
final cacheControl =
response.headers['cache-control']?.toLowerCase() ?? '';
final headerAge = response.headers['age']?.toLowerCase() ?? '';
try {
if (cacheControl.isNotEmpty) {
final maxAge = _getMaxAge(cacheControl);
final age = int.tryParse(headerAge) ?? 0 ;
final age = int.tryParse(headerAge) ?? 0;
if (maxAge != null) {
final now = DateTime.now();
expireAt = now.add(Duration(seconds: maxAge - age));
Expand Down

0 comments on commit 7f04df1

Please sign in to comment.