Skip to content

Commit

Permalink
✏️ fix: using private lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
wssgcg1213 authored and andycall committed Aug 24, 2021
1 parent 2168b83 commit f695090
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions kraken/lib/src/foundation/http_cache_object.dart
Expand Up @@ -12,11 +12,10 @@ import 'package:path/path.dart' as path;

import 'http_client_response.dart';

const String HttpHeadersCacheHits = 'cache-hits';
const String HttpCacheHit = 'HIT';
const String HttpCacheMiss = 'MISS';

class HttpCacheObject {
static const _httpHeaderCacheHits = 'cache-hits';
static const _httpCacheHit = 'HIT';

// The cached url of resource.
String url;

Expand Down Expand Up @@ -255,7 +254,7 @@ class HttpCacheObject {
if (expiredTime != null) HttpHeaders.expiresHeader: HttpDate.format(expiredTime!),
if (contentLength != null) HttpHeaders.contentLengthHeader: contentLength.toString(),
if (lastModified != null) HttpHeaders.lastModifiedHeader: HttpDate.format(lastModified!),
HttpHeadersCacheHits: HttpCacheHit,
_httpHeaderCacheHits: _httpCacheHit,
};
}

Expand Down
4 changes: 2 additions & 2 deletions kraken/test/src/foundation/http_cache.dart
Expand Up @@ -38,7 +38,7 @@ void main() {
server.getUri('json_with_content_length_expires_etag_last_modified'));
KrakenHttpOverrides.setContextHeader(requestSecond, contextId);
var responseSecond = await requestSecond.close();
expect(responseSecond.headers.value(HttpHeadersCacheHits), HttpCacheHit);
expect(responseSecond.headers.value('cache-hits'), 'HIT');
});

test('Negotiation cache last-modified', () async {
Expand Down Expand Up @@ -94,7 +94,7 @@ void main() {

var response = await cacheObject.toHttpClientResponse();
assert(response != null);
expect(response!.headers.value(HttpHeadersCacheHits), HttpCacheHit);
expect(response!.headers.value('cache-hits'), 'HIT');

Uint8List bytesFromCache = await consolidateHttpClientResponseBytes(response);
expect(bytesFromCache.length, response.contentLength);
Expand Down

0 comments on commit f695090

Please sign in to comment.