From 0e8b43a10bc8e2d5e5bf579f1e0a936279722314 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Mon, 14 Oct 2024 20:02:18 -0300 Subject: [PATCH] fix after rebase --- Sources/Auth/Internal/APIClient.swift | 2 +- Sources/Auth/Internal/Contants.swift | 3 +-- Sources/Functions/FunctionsClient.swift | 18 ------------------ .../xcshareddata/swiftpm/Package.resolved | 9 +++++++++ 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/Sources/Auth/Internal/APIClient.swift b/Sources/Auth/Internal/APIClient.swift index 2b8c52ab..fc2d8521 100644 --- a/Sources/Auth/Internal/APIClient.swift +++ b/Sources/Auth/Internal/APIClient.swift @@ -106,7 +106,7 @@ struct APIClient: Sendable { } } - private func parseResponseAPIVersion(_ response: HTTPResponse) -> Date? { + private func parseResponseAPIVersion(_ response: Helpers.HTTPResponse) -> Date? { guard let apiVersion = response.headers[.apiVersionHeaderName] else { return nil } let formatter = ISO8601DateFormatter() diff --git a/Sources/Auth/Internal/Contants.swift b/Sources/Auth/Internal/Contants.swift index 8a433ae3..e504a2ee 100644 --- a/Sources/Auth/Internal/Contants.swift +++ b/Sources/Auth/Internal/Contants.swift @@ -15,10 +15,9 @@ let autoRefreshTickDuration: TimeInterval = 30 let autoRefreshTickThreshold = 3 let defaultStorageKey = "supabase.auth.token" -let apiVersionHeaderName = "X-Supabase-Api-Version" extension HTTPField.Name { - static let apiVersionHeaderName = HTTPField.Name(apiVersionHeaderName)! + static let apiVersionHeaderName = HTTPField.Name("X-Supabase-Api-Version")! } let apiVersions: [APIVersion.Name: APIVersion] = [ diff --git a/Sources/Functions/FunctionsClient.swift b/Sources/Functions/FunctionsClient.swift index 43ba5313..e9be2f71 100644 --- a/Sources/Functions/FunctionsClient.swift +++ b/Sources/Functions/FunctionsClient.swift @@ -34,24 +34,6 @@ public final class FunctionsClient: Sendable { mutableState.headers } - init( - url: URL, - headers: [String: String], - region: String?, - http: any HTTPClientType - ) { - self.url = url - self.region = region - self.http = http - - mutableState.withValue { - $0.headers = HTTPHeaders(headers) - if $0.headers["X-Client-Info"] == nil { - $0.headers["X-Client-Info"] = "functions-swift/\(version)" - } - } - } - /// Initializes a new instance of `FunctionsClient`. /// /// - Parameters: diff --git a/Supabase.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Supabase.xcworkspace/xcshareddata/swiftpm/Package.resolved index 52f217aa..21ad5848 100644 --- a/Supabase.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Supabase.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -90,6 +90,15 @@ "version" : "1.3.3" } }, + { + "identity" : "swift-http-types", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-types", + "state" : { + "revision" : "ae67c8178eb46944fd85e4dc6dd970e1f3ed6ccd", + "version" : "1.3.0" + } + }, { "identity" : "swift-identified-collections", "kind" : "remoteSourceControl",