Skip to content

Commit

Permalink
Apply minio#1234
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyaveni committed Jan 3, 2024
1 parent ff816e7 commit 82b4999
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/minio.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,13 @@ export class Client extends TypedClient {
// * `expiry` _number_: expiry in seconds (optional, default 7 days)
// * `reqParams` _object_: request parameters (optional) e.g {versionId:"10fa9946-3f64-4137-a58f-888065c0732e"}
// * `requestDate` _Date_: A date object, the url will be issued at (optional)
presignedUrl(method, bucketName, objectName, expires, reqParams, requestDate, cb) {
presignedUrl(method, bucketName, objectName, expires, reqParams, requestDate, signedHost, cb) {
if (this.anonymous) {
throw new errors.AnonymousRequestError('Presigned ' + method + ' url cannot be generated for anonymous requests')
}
if (isFunction(signedHost)) {
cb = signedHost
}
if (isFunction(requestDate)) {
cb = requestDate
requestDate = new Date()
Expand Down Expand Up @@ -670,7 +673,11 @@ export class Client extends TypedClient {
// This statement is added to ensure that we send error through
// callback on presign failure.
var url
var reqOptions = this.getRequestOptions({ method, region, bucketName, objectName, query })
var headers = {}
if(signedHost) {
headers.host = signedHost
}
var reqOptions = this.getRequestOptions({ method, region, bucketName, objectName, query, headers })

this.checkAndRefreshCreds()
try {
Expand Down

0 comments on commit 82b4999

Please sign in to comment.