From b0494b7cc3ebf8fad4d0653b08be3ea930ab8d5b Mon Sep 17 00:00:00 2001 From: markrosan8 Date: Sat, 4 Apr 2026 04:46:09 -0400 Subject: [PATCH] Add custom HTTP header support for proxies --- OpenCloudSDK/Connection/OCConnection.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OpenCloudSDK/Connection/OCConnection.m b/OpenCloudSDK/Connection/OCConnection.m index af5997b1..ed3acb81 100644 --- a/OpenCloudSDK/Connection/OCConnection.m +++ b/OpenCloudSDK/Connection/OCConnection.m @@ -715,6 +715,16 @@ - (OCHTTPRequest *)pipeline:(OCHTTPPipeline *)pipeline prepareRequestForScheduli [request addHeaderFields:_staticHeaderFields]; } + // Custom HTTP header from user settings + NSString *customHeaderName = [[NSUserDefaults standardUserDefaults] stringForKey:@"custom-http-header-name"]; + NSString *customHeaderValue = [[NSUserDefaults standardUserDefaults] stringForKey:@"custom-http-header-value"]; + + if ((customHeaderName != nil) && (customHeaderName.length > 0) && + (customHeaderValue != nil) && (customHeaderValue.length > 0)) + { + [request setValue:customHeaderValue forHeaderField:customHeaderName]; + } + return (request); }