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); }