Skip to content

Commit

Permalink
fix: only match zero or one occurrence of .cn suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHeckrath authored Aug 6, 2018
1 parent d7a83e5 commit 97bf56c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aws4.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function RequestSigner(request, credentials) {
}

RequestSigner.prototype.matchHost = function(host) {
var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)*$/)
var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)?$/)
var hostParts = (match || []).slice(1, 3)

// ES's hostParts are sometimes the other way round, if the value that is expected
Expand Down

0 comments on commit 97bf56c

Please sign in to comment.