mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-09 19:12:15 +02:00
Merge pull request #16082 from mattr1x/add-mac-user-agent-launcher
DEV-417: Add User-Agent string to macOS Launcher
This commit is contained in:
commit
33070b4579
8 changed files with 24 additions and 10 deletions
|
@ -89,8 +89,14 @@ if ("${LAUNCHER_HMAC_SECRET}" STREQUAL "")
|
|||
message(FATAL_ERROR "LAUNCHER_HMAC_SECRET is not set")
|
||||
endif()
|
||||
|
||||
# Development environments don't set BUILD_VERSION. Let 0 mean a development version.
|
||||
if(NOT BUILD_VERSION)
|
||||
set(BUILD_VERSION 0)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE LAUNCHER_HMAC_SECRET="${LAUNCHER_HMAC_SECRET}")
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE LAUNCHER_BUILD_VERSION="${BUILD_VERSION}")
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE USER_AGENT_STRING="HQLauncher/${BUILD_VERSION}")
|
||||
|
||||
file(GLOB NIB_FILES "nib/*.xib")
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
NSMutableURLRequest *request = [NSMutableURLRequest new];
|
||||
[request setURL:[NSURL URLWithString:@"https://metaverse.highfidelity.com/oauth/token"]];
|
||||
[request setHTTPMethod:@"POST"];
|
||||
[request setValue:@USER_AGENT_STRING forHTTPHeaderField:@"User-Agent"];
|
||||
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
|
||||
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
|
||||
[request setHTTPBody:postData];
|
||||
|
|
|
@ -12,9 +12,10 @@
|
|||
{
|
||||
self.progressPercentage = 0.0;
|
||||
self.taskProgressPercentage = 0.0;
|
||||
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:domainContentUrl]
|
||||
cachePolicy:NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval:60.0];
|
||||
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:domainContentUrl]
|
||||
cachePolicy:NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval:60.0];
|
||||
[request setValue:@USER_AGENT_STRING forHTTPHeaderField:@"User-Agent"];
|
||||
|
||||
NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
NSURLSession *defaultSession = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: self delegateQueue: [NSOperationQueue mainQueue]];
|
||||
|
|
|
@ -8,9 +8,10 @@
|
|||
{
|
||||
self.progressPercentage = 0.0;
|
||||
self.taskProgressPercentage = 0.0;
|
||||
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:downloadUrl]
|
||||
cachePolicy:NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval:60.0];
|
||||
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:downloadUrl]
|
||||
cachePolicy:NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval:60.0];
|
||||
[request setValue:@USER_AGENT_STRING forHTTPHeaderField:@"User-Agent"];
|
||||
|
||||
NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
NSURLSession *defaultSession = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: self delegateQueue: [NSOperationQueue mainQueue]];
|
||||
|
|
|
@ -5,9 +5,10 @@
|
|||
@implementation DownloadLauncher
|
||||
|
||||
- (void) downloadLauncher:(NSString*)launcherUrl {
|
||||
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:launcherUrl]
|
||||
cachePolicy:NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval:60.0];
|
||||
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:launcherUrl]
|
||||
cachePolicy:NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval:60.0];
|
||||
[request setValue:@USER_AGENT_STRING forHTTPHeaderField:@"User-Agent"];
|
||||
|
||||
NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
NSURLSession *defaultSession = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: self delegateQueue: [NSOperationQueue mainQueue]];
|
||||
|
|
|
@ -5,9 +5,11 @@
|
|||
|
||||
- (void) downloadScripts:(NSString*) scriptsUrl
|
||||
{
|
||||
/*NSURLRequest* theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:scriptsUrl]
|
||||
/*NSMutableURLRequest* theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:scriptsUrl]
|
||||
cachePolicy:NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval:6000.0];
|
||||
[theRequest setValue:@USER_AGENT_STRING forHTTPHeaderField:@"User-Agent"];
|
||||
|
||||
NSURLDownload *theDownload = [[NSURLDownload alloc] initWithRequest:theRequest delegate:self];
|
||||
|
||||
if (!theDownload) {
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
NSMutableURLRequest* request = [NSMutableURLRequest new];
|
||||
[request setURL:[NSURL URLWithString:@"https://thunder.highfidelity.com/builds/api/tags/latest?format=json"]];
|
||||
[request setHTTPMethod:@"GET"];
|
||||
[request setValue:@USER_AGENT_STRING forHTTPHeaderField:@"User-Agent"];
|
||||
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
|
||||
|
||||
// We're using an ephermeral session here to ensure the tags api response is never cached.
|
||||
|
|
|
@ -32,6 +32,7 @@ static NSString* const organizationURL = @"https://orgs.highfidelity.com/organiz
|
|||
NSMutableURLRequest *request = [NSMutableURLRequest new];
|
||||
[request setURL:[NSURL URLWithString:[organizationURL stringByAppendingString:jsonFile]]];
|
||||
[request setHTTPMethod:@"GET"];
|
||||
[request setValue:@USER_AGENT_STRING forHTTPHeaderField:@"User-Agent"];
|
||||
[request setValue:@"" forHTTPHeaderField:@"Content-Type"];
|
||||
|
||||
NSURLSession * session = [NSURLSession sessionWithConfiguration:NSURLSessionConfiguration.ephemeralSessionConfiguration delegate: self delegateQueue: [NSOperationQueue mainQueue]];
|
||||
|
|
Loading…
Reference in a new issue