mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2026-03-27 22:40:08 +01:00
♻️ Tweak order of methods and variables
This commit is contained in:
@@ -11,15 +11,6 @@ import Foundation
|
||||
class RealWebApi: WebApiProtocol {
|
||||
var container: Container
|
||||
|
||||
var defaultHeaders: HttpHeaders {
|
||||
return [
|
||||
"User-Agent": "phpmon-nur/2.0",
|
||||
"X-phpmon-version": "\(App.shortVersion) (\(App.bundleVersion))",
|
||||
"X-phpmon-os-version": "\(App.macVersion)",
|
||||
"X-phpmon-bundle-id": "\(App.identifier)"
|
||||
]
|
||||
}
|
||||
|
||||
init(container: Container) {
|
||||
self.container = container
|
||||
}
|
||||
@@ -62,7 +53,7 @@ class RealWebApi: WebApiProtocol {
|
||||
|
||||
func get(
|
||||
_ url: URL,
|
||||
withHeaders headers: HttpHeaders = [:],
|
||||
withHeaders headers: HttpHeaders,
|
||||
withTimeout timeout: TimeInterval = URLSession.shared.configuration.timeoutIntervalForRequest
|
||||
) async throws -> WebApiResponse {
|
||||
try await self.request(
|
||||
@@ -88,4 +79,13 @@ class RealWebApi: WebApiProtocol {
|
||||
timeout: timeout
|
||||
)
|
||||
}
|
||||
|
||||
var defaultHeaders: HttpHeaders {
|
||||
return [
|
||||
"User-Agent": "phpmon-nur/2.0",
|
||||
"X-phpmon-version": "\(App.shortVersion) (\(App.bundleVersion))",
|
||||
"X-phpmon-os-version": "\(App.macVersion)",
|
||||
"X-phpmon-bundle-id": "\(App.identifier)"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user