Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion com/api.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ component accessors="true" {
public struct function resolveRequestSettings(
struct awsCredentials = { },
string region = defaultRegion,
string bucket = ''
string bucket = '',
string host = ''
) {
if ( !awsCredentials.isEmpty() ) {
awsCredentials = credentials.defaultCredentials( argumentCollection = awsCredentials );
Expand All @@ -44,6 +45,9 @@ component accessors="true" {
if ( len( arguments.bucket ) ) {
settings.bucket = arguments.bucket;
}
if( len( arguments.host )){
settings.host = arguments.host;
}
return settings;
}

Expand Down
15 changes: 13 additions & 2 deletions services/ssm.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ component {
) {
variables.api = arguments.api;
variables.apiVersion = arguments.settings.apiVersion;
variables.settings = arguments.settings;
return this;
}

Expand Down Expand Up @@ -50,7 +51,12 @@ component {
public string function getHost(
required string region
) {
return variables.service & '.' & region & '.amazonaws.com';
if ( structKeyExists( variables.settings, 'host' ) && len( variables.settings.host ) ) {
var host = variables.settings.host;
} else {
var host = variables.service & '.' & region & '.amazonaws.com';
}
return host;
}

private any function apiCall(
Expand All @@ -76,7 +82,12 @@ component {
payloadString,
requestSettings.awsCredentials
);
apiResponse[ 'data' ] = deserializeJSON( apiResponse.rawData );
if (isJson(apiResponse.rawData)){
apiResponse[ 'data' ] = deserializeJSON( apiResponse.rawData );
}else{
apiResponse[ 'data' ] = apiResponse.rawData;
}


return apiResponse;
}
Expand Down