Can't fetch all media from S3 Bucket After Upgrading to 4.12.5

System Information
  • Strapi Version: 4.12.5
  • Operating System: Mac OS
  • Database: PostgresSQL
  • Node Version: 18.17.1
  • NPM Version: 9.8.1
  • Yarn Version: 1.22.19

I recently updated both my Strapi version and Node.js version, and since then, I’ve been having trouble fetching all media documents from my S3 bucket using the Strapi Media Library API. It seems that the API is adding incorrect query parameters to the requests, causing issues in retrieving the files. Can someone guide me on how to fix this problem and ensure that the correct query parameters are being used for fetching media documents from the S3 bucket?

The endpoints: