Skip to content

Add support for Cache-Control in Directory and File HTTPHandler#194

Merged
swhitty merged 4 commits intoswhitty:mainfrom
nspassov:feature/cache-control
Apr 1, 2026
Merged

Add support for Cache-Control in Directory and File HTTPHandler#194
swhitty merged 4 commits intoswhitty:mainfrom
nspassov:feature/cache-control

Conversation

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 77.65957% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.39%. Comparing base (a8358d1) to head (9454ebc).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
FlyingFox/Sources/HTTPCacheControl.swift 77.19% 13 Missing ⚠️
...ingFox/Sources/Handlers/DirectoryHTTPHandler.swift 80.00% 4 Missing ⚠️
FlyingFox/Sources/Handlers/FileHTTPHandler.swift 76.47% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
- Coverage   92.80%   92.39%   -0.42%     
==========================================
  Files          68       69       +1     
  Lines        3448     3536      +88     
==========================================
+ Hits         3200     3267      +67     
- Misses        248      269      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nspassov nspassov force-pushed the feature/cache-control branch 2 times, most recently from 6993b14 to 463cf9b Compare March 31, 2026 08:49
@nspassov nspassov force-pushed the feature/cache-control branch from 463cf9b to 35a3a6b Compare March 31, 2026 08:51
@nspassov nspassov changed the title Add support for Cache-Control in DirectoryHTTPHandler Add support for Cache-Control in Directory and File HTTPHandler Mar 31, 2026
@nspassov
Copy link
Copy Markdown
Contributor Author

Hey @swhitty , what are your thoughts on this?


static func getETagValue(for data: Data) -> String? {
#if canImport(CryptoKit)
let sha256digest = SHA256.hash(data: data)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a cross platform SHA1 implementation in this repo that could be used instead — or at least used on other platforms without CryptoKit.

Even though SHA1 is not secure I don't think it matters for eTags really especially in the context of this DirectoryHTTPHandler

Copy link
Copy Markdown
Owner

@swhitty swhitty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you 🙏🏻

@swhitty swhitty merged commit 4b4e8fc into swhitty:main Apr 1, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants