Skip to content

Commit

Permalink
alternative ssl check approach proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Toozs committed Mar 12, 2024
1 parent c5e5fcf commit a66f293
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/api/apiUtils/authorization/permissionChecks.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,14 @@ function _checkBucketPolicyConditions(request, conditions, log) {
if (!conditions) {
return true;
}
const viaProxy = config.requests.viaProxy;

const sslEnabled = (viaProxy ?
request.headers['x-forwarded-proto'] === 'https' : request.connection.encrypted);
// build request context from the request!
const requestContext = new RequestContext(request.headers, request.query,
request.bucketName, request.objectKey, ip,
request.connection.encrypted, request.resourceType, 's3', null, null,
sslEnabled, request.resourceType, 's3', null, null,
null, null, null, null, null, null, null, null, null,
request.objectLockRetentionDays);
return evaluators.meetConditions(requestContext, conditions, log);
Expand Down

0 comments on commit a66f293

Please sign in to comment.