Skip to content

Commit

Permalink
removed sqs. from hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
kcajmagic committed Jun 3, 2019
1 parent 8d635c3 commit 4d35136
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/conf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func LoadYamlConfig(filename string, env string) []string {
queueUrl := "http://" + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port +
"/" + app.CurrentEnvironment.AccountID + "/" + queue.Name
if app.CurrentEnvironment.Region != "" {
queueUrl = "http://sqs." + app.CurrentEnvironment.Region + "." + app.CurrentEnvironment.Host + ":" +
queueUrl = "http://" + app.CurrentEnvironment.Region + "." + app.CurrentEnvironment.Host + ":" +
app.CurrentEnvironment.Port + "/" + app.CurrentEnvironment.AccountID + "/" + queue.Name
}
queueArn := "arn:aws:sqs:" + app.CurrentEnvironment.Region + ":" + app.CurrentEnvironment.AccountID + ":" + queue.Name
Expand Down Expand Up @@ -109,7 +109,7 @@ func LoadYamlConfig(filename string, env string) []string {
queueUrl := "http://" + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port +
"/" + app.CurrentEnvironment.AccountID + "/" + subs.QueueName
if app.CurrentEnvironment.Region != "" {
queueUrl = "http://sqs." + app.CurrentEnvironment.Region + "." + app.CurrentEnvironment.Host + ":" +
queueUrl = "http://" + app.CurrentEnvironment.Region + "." + app.CurrentEnvironment.Host + ":" +
app.CurrentEnvironment.Port + "/" + app.CurrentEnvironment.AccountID + "/" + subs.QueueName
}
queueArn := "arn:aws:sqs:" + app.CurrentEnvironment.Region + ":" + app.CurrentEnvironment.AccountID + ":" + subs.QueueName
Expand Down
12 changes: 6 additions & 6 deletions app/gosns/gosns.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ func Subscribe(w http.ResponseWriter, req *http.Request) {
Token: token,
TopicArn: topicArn,
Message: "You have chosen to subscribe to the topic " + topicArn + ".\nTo confirm the subscription, visit the SubscribeURL included in this message.",
SigningCertURL: "http://sqs." + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/SimpleNotificationService/" + uuid + ".pem",
SigningCertURL: "http://" + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/SimpleNotificationService/" + uuid + ".pem",
SignatureVersion: "1",
SubscribeURL: "http://sqs." + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/?Action=ConfirmSubscription&TopicArn=" + topicArn + "&Token=" + token,
SubscribeURL: "http://" + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/?Action=ConfirmSubscription&TopicArn=" + topicArn + "&Token=" + token,
Timestamp: time.Now().UTC().Format(time.RFC3339),
}
signature, err := signMessage(PrivateKEY, snsMSG)
Expand Down Expand Up @@ -552,8 +552,8 @@ func publishHTTP(subs *app.Subscription, messageBody string, messageAttributes m
Message: messageBody,
Timestamp: time.Now().UTC().Format(time.RFC3339),
SignatureVersion: "1",
SigningCertURL: "http://sqs." + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/SimpleNotificationService/" + id + ".pem",
UnsubscribeURL: "http://sqs." + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/?Action=Unsubscribe&SubscriptionArn=" + subs.SubscriptionArn,
SigningCertURL: "http://" + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/SimpleNotificationService/" + id + ".pem",
UnsubscribeURL: "http://" + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/?Action=Unsubscribe&SubscriptionArn=" + subs.SubscriptionArn,
MessageAttributes: formatAttributes(messageAttributes),
}

Expand Down Expand Up @@ -679,8 +679,8 @@ func CreateMessageBody(subs *app.Subscription, msg string, subject string, messa
Subject: subject,
Timestamp: time.Now().UTC().Format(time.RFC3339),
SignatureVersion: "1",
SigningCertURL: "http://sqs." + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/SimpleNotificationService/" + msgId + ".pem",
UnsubscribeURL: "http://sqs." + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/?Action=Unsubscribe&SubscriptionArn=" + subs.SubscriptionArn,
SigningCertURL: "http://" + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/SimpleNotificationService/" + msgId + ".pem",
UnsubscribeURL: "http://" + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port + "/?Action=Unsubscribe&SubscriptionArn=" + subs.SubscriptionArn,
MessageAttributes: formatAttributes(messageAttributes),
}

Expand Down
2 changes: 1 addition & 1 deletion app/gosqs/gosqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func CreateQueue(w http.ResponseWriter, req *http.Request) {
queueUrl := "http://" + app.CurrentEnvironment.Host + ":" + app.CurrentEnvironment.Port +
"/" + app.CurrentEnvironment.AccountID + "/" + queueName
if app.CurrentEnvironment.Region != "" {
queueUrl = "http://sqs." + app.CurrentEnvironment.Region + "." + app.CurrentEnvironment.Host + ":" +
queueUrl = "http://" + app.CurrentEnvironment.Region + "." + app.CurrentEnvironment.Host + ":" +
app.CurrentEnvironment.Port + "/" + app.CurrentEnvironment.AccountID + "/" + queueName
}
queueArn := "arn:aws:sqs:" + app.CurrentEnvironment.Region + ":" + app.CurrentEnvironment.AccountID + ":" + queueName
Expand Down

0 comments on commit 4d35136

Please sign in to comment.