Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed streamFile deprecation + deactivated advancedETagComparison by default #3177

Merged
merged 25 commits into from Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6392916
Update FileIO.swift
linus-hologram May 4, 2023
e041d35
Merge branch 'vapor:main' into main
linus-hologram May 4, 2023
baa7fc4
Introduced new streamFile method
linus-hologram May 14, 2023
b36e2db
Merge branch 'main' of https://github.com/linus-hologram/vapor
linus-hologram May 14, 2023
19b942e
Updated Unit Tests
linus-hologram May 14, 2023
7933b99
Added more documentation
linus-hologram May 14, 2023
e2c3e4e
Removed unnecessary CryptoKit import
linus-hologram May 15, 2023
f554ecc
Merge branch 'main' into main
linus-hologram May 15, 2023
09507c1
added closure return types
linus-hologram May 15, 2023
1f6e0aa
Merge branch 'main' of https://github.com/linus-hologram/vapor
linus-hologram May 15, 2023
7236cc7
Merge branch 'vapor:main' into main
linus-hologram May 20, 2023
f192a76
incorporated first round of @0xTim's feedback
linus-hologram May 20, 2023
37f16d1
added test cases to account for advanced/simple etags
linus-hologram May 25, 2023
c0207f4
Merge branch 'vapor:main' into main
linus-hologram May 25, 2023
e83c3c8
Merge branch 'main' into main
linus-hologram Jun 15, 2023
798e40d
Incorporated PR comments
linus-hologram Apr 19, 2024
0dc971d
Added test for legacy streamFile
linus-hologram Apr 19, 2024
7badd00
Merge branch 'main' of https://github.com/vapor/vapor
linus-hologram Apr 19, 2024
8631e42
Deprecated method to silence warnings
linus-hologram Apr 19, 2024
23a36b3
Warning fixes
linus-hologram Apr 19, 2024
0a9b49f
following @gwynne's style advice :)
linus-hologram Apr 19, 2024
52bbc35
Merge branch 'main' into main
0xTim Apr 19, 2024
49869ae
Merge branch 'main' into main
gwynne Apr 21, 2024
d3806a4
Merge remote-tracking branch 'refs/remotes/upstream/main'
linus-hologram Apr 23, 2024
0b37f9c
undone deprecation + default of new advancedEtagComparison
linus-hologram Apr 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Vapor/Middleware/FileMiddleware.swift
Expand Up @@ -40,7 +40,7 @@ public final class FileMiddleware: Middleware {
/// an absolute path from the public directory root. If `nil`, no default files are served.
/// - directoryAction: Determines the action to take when the request doesn't have a trailing slash but matches a directory.
/// - advancedETagComparison: The method used when ETags are generated. If true, a byte-by-byte hash is created (and cached), otherwise a simple comparison based on the file's last modified date and size.
public init(publicDirectory: String, defaultFile: String? = nil, directoryAction: DirectoryAction = .none, advancedETagComparison: Bool = true) {
public init(publicDirectory: String, defaultFile: String? = nil, directoryAction: DirectoryAction = .none, advancedETagComparison: Bool = false) {
self.publicDirectory = publicDirectory.addTrailingSlash()
self.defaultFile = defaultFile
self.directoryAction = directoryAction
Expand Down
1 change: 0 additions & 1 deletion Sources/Vapor/Utilities/FileIO.swift
Expand Up @@ -123,7 +123,6 @@ public struct FileIO: Sendable {
/// - mediaType: HTTPMediaType, if not specified, will be created from file extension.
/// - onCompleted: Closure to be run on completion of stream.
/// - returns: A `200 OK` response containing the file stream and appropriate headers.
@available(*, deprecated, message: "Use the new `streamFile` method which returns EventLoopFuture<Response>")
@preconcurrency public func streamFile(
at path: String,
chunkSize: Int = NonBlockingFileIO.defaultChunkSize,
Expand Down