diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 89d0484..74d09d1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ on: jobs: test: - runs-on: macos-latest + runs-on: macos-26 steps: - name: Checkout repo diff --git a/Package.swift b/Package.swift index 8b1d861..51fc057 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.5 +// swift-tools-version:6.2 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/Sources/SimpleHTTP/MultipartForm/MultipartFormData.swift b/Sources/SimpleHTTP/MultipartForm/MultipartFormData.swift index 3fe7e6b..38d732c 100644 --- a/Sources/SimpleHTTP/MultipartForm/MultipartFormData.swift +++ b/Sources/SimpleHTTP/MultipartForm/MultipartFormData.swift @@ -7,7 +7,7 @@ import MobileCoreServices import CoreServices #endif -struct Header: Hashable { +struct Header: Hashable, Sendable { let name: HTTPHeader let value: String } @@ -16,9 +16,9 @@ enum EncodingCharacters { static let crlf = "\r\n" } -enum Boundary { +enum Boundary: Sendable { - enum `Type` { + enum `Type`: Sendable { case initial case encapsulated case final @@ -49,19 +49,19 @@ enum Boundary { struct BodyPart { let headers: [Header] let length: Int - let stream: () throws -> InputStream + let stream: @Sendable () throws -> InputStream var hasInitialBoundary = false var hasFinalBoundary = false - private init(headers: [Header], stream: @escaping () throws -> InputStream, length: Int) { + private init(headers: [Header], stream: @Sendable @escaping () throws -> InputStream, length: Int) { self.headers = headers self.length = length self.stream = stream } init(headers: [Header], url: URL, length: Int) { - let stream: () throws -> InputStream = { + let stream: @Sendable () throws -> InputStream = { guard let stream = InputStream(url: url) else { throw MultipartFormData.Error.inputStreamCreationFailed(url) } diff --git a/Sources/SimpleHTTP/Request/Path.swift b/Sources/SimpleHTTP/Request/Path.swift index 3cfc1fd..52ce478 100644 --- a/Sources/SimpleHTTP/Request/Path.swift +++ b/Sources/SimpleHTTP/Request/Path.swift @@ -21,7 +21,7 @@ import Foundation /// /// let user: Path = .myPaths.user /// ``` -public struct Path: Equatable, ExpressibleByStringLiteral, ExpressibleByStringInterpolation { +public struct Path: Equatable, Sendable, ExpressibleByStringLiteral, ExpressibleByStringInterpolation { /// relative path public let value: String diff --git a/Sources/SimpleHTTP/Request/Request.swift b/Sources/SimpleHTTP/Request/Request.swift index 269954c..b579ad0 100644 --- a/Sources/SimpleHTTP/Request/Request.swift +++ b/Sources/SimpleHTTP/Request/Request.swift @@ -1,6 +1,6 @@ import Foundation -public enum Method: String { +public enum Method: String, Sendable { case get case post case put diff --git a/Sources/SimpleHTTP/Response/DataResponse.swift b/Sources/SimpleHTTP/Response/DataResponse.swift index bf90cb5..b7b27b7 100644 --- a/Sources/SimpleHTTP/Response/DataResponse.swift +++ b/Sources/SimpleHTTP/Response/DataResponse.swift @@ -1,6 +1,6 @@ import Foundation -public struct URLDataResponse { +public struct URLDataResponse: Sendable { public let data: Data public let response: HTTPURLResponse diff --git a/Sources/SimpleHTTPFoundation/HTTP/HTTPContentType.swift b/Sources/SimpleHTTPFoundation/HTTP/HTTPContentType.swift index 7eaf3bb..1af6ac7 100644 --- a/Sources/SimpleHTTPFoundation/HTTP/HTTPContentType.swift +++ b/Sources/SimpleHTTPFoundation/HTTP/HTTPContentType.swift @@ -1,7 +1,7 @@ import Foundation /// A struct representing a http header content type value -public struct HTTPContentType: Hashable, ExpressibleByStringLiteral { +public struct HTTPContentType: Hashable, Sendable, ExpressibleByStringLiteral { public let value: String public init(value: String) { diff --git a/Sources/SimpleHTTPFoundation/HTTP/HTTPHeader.swift b/Sources/SimpleHTTPFoundation/HTTP/HTTPHeader.swift index f1c3f1f..b4b9eb1 100644 --- a/Sources/SimpleHTTPFoundation/HTTP/HTTPHeader.swift +++ b/Sources/SimpleHTTPFoundation/HTTP/HTTPHeader.swift @@ -4,7 +4,7 @@ import Foundation public typealias HTTPHeaderFields = [HTTPHeader: String] /// A struct representing a http request header key -public struct HTTPHeader: Hashable, ExpressibleByStringLiteral { +public struct HTTPHeader: Hashable, Sendable, ExpressibleByStringLiteral { public let key: String public init(stringLiteral value: StringLiteralType) { @@ -17,7 +17,7 @@ extension HTTPHeader { public static let authentication: Self = "Authentication" public static let authorization: Self = "Authorization" public static let contentType: Self = "Content-Type" - public static var contentDisposition: Self = "Content-Disposition" + public static let contentDisposition: Self = "Content-Disposition" } // swiftlint:disable line_length