Skip to content

Commit

Permalink
Fix bucket name parsing when url contains query parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
djmaze committed Jun 5, 2020
1 parent e9f67d3 commit 6df2914
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion s3-auth-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ var handle_request = function (client_request, client_response) {
return
}

const bucket = client_request.url.split('/')[1]
const request_url = url.parse(client_request.url)
const bucket = request_url.pathname.split('/')[1]
if (bucket && !allowedBuckets.includes(bucket) && !bucket.startsWith('probe-bucket-sign-')) {
console.error('disallowed bucket', bucket)
client_response.writeHead(403)
Expand Down

0 comments on commit 6df2914

Please sign in to comment.