Skip to content

Commit

Permalink
undone deprecation + default of new advancedEtagComparison
Browse files Browse the repository at this point in the history
  • Loading branch information
linus-hologram committed Apr 23, 2024
1 parent d3806a4 commit 0b37f9c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
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

0 comments on commit 0b37f9c

Please sign in to comment.