mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 04:10:04 +02:00
update modules
This commit is contained in:
22
node_modules/aws4/aws4.js
generated
vendored
22
node_modules/aws4/aws4.js
generated
vendored
@@ -33,7 +33,7 @@ function RequestSigner(request, credentials) {
|
||||
if (typeof request === 'string') request = url.parse(request)
|
||||
|
||||
var headers = request.headers = (request.headers || {}),
|
||||
hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host)
|
||||
hostParts = (!this.service || !this.region) && this.matchHost(request.hostname || request.host || headers.Host || headers.host)
|
||||
|
||||
this.request = request
|
||||
this.credentials = credentials || this.defaultCredentials()
|
||||
@@ -70,6 +70,19 @@ RequestSigner.prototype.matchHost = function(host) {
|
||||
if (hostParts[1] === 'es')
|
||||
hostParts = hostParts.reverse()
|
||||
|
||||
if (hostParts[1] == 's3') {
|
||||
hostParts[0] = 's3'
|
||||
hostParts[1] = 'us-east-1'
|
||||
} else {
|
||||
for (var i = 0; i < 2; i++) {
|
||||
if (/^s3-/.test(hostParts[i])) {
|
||||
hostParts[1] = hostParts[i].slice(3)
|
||||
hostParts[0] = 's3'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return hostParts
|
||||
}
|
||||
|
||||
@@ -83,10 +96,9 @@ RequestSigner.prototype.isSingleRegion = function() {
|
||||
}
|
||||
|
||||
RequestSigner.prototype.createHost = function() {
|
||||
var region = this.isSingleRegion() ? '' :
|
||||
(this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region,
|
||||
service = this.service === 'ses' ? 'email' : this.service
|
||||
return service + region + '.amazonaws.com'
|
||||
var region = this.isSingleRegion() ? '' : '.' + this.region,
|
||||
subdomain = this.service === 'ses' ? 'email' : this.service
|
||||
return subdomain + region + '.amazonaws.com'
|
||||
}
|
||||
|
||||
RequestSigner.prototype.prepareRequest = function() {
|
||||
|
Reference in New Issue
Block a user