From df7476c54b4a4a1dab1a0391b93ceeb9df4d6ccd Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Tue, 18 Nov 2025 15:41:09 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Tweak=20order=20of=20metho?= =?UTF-8?q?ds=20and=20variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpmon/Common/Http/RealWebApi.swift | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/phpmon/Common/Http/RealWebApi.swift b/phpmon/Common/Http/RealWebApi.swift index 0353a9bc..0491c676 100644 --- a/phpmon/Common/Http/RealWebApi.swift +++ b/phpmon/Common/Http/RealWebApi.swift @@ -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)" + ] + } }