Skip to content

Commit

Permalink
Limit hostname labels to 63 chars max
Browse files Browse the repository at this point in the history
63 octets is the maximum length a hostname label can be: https://en.wikipedia.org/wiki/Hostname#Syntax
  • Loading branch information
mhart committed Aug 28, 2024
1 parent 944f898 commit 7a0f4e9
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 @@ -78,7 +78,7 @@ function RequestSigner(request, credentials) {
}

RequestSigner.prototype.matchHost = function(host) {
var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)?$/)
var match = (host || '').match(/([^\.]{1,63})\.(?:([^\.]{0,63})\.)?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 7a0f4e9

Please sign in to comment.