-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
525 make an easy minio example using the test application inside the howard repo #529
525 make an easy minio example using the test application inside the howard repo #529
Conversation
…o-example-using-the-test-application-inside-the-howard-repo
…t-application-inside-the-howard-repo
…on-inside-the-howard-repo' of https://github.com/ai-cfia/howard into 525-make-an-easy-minio-example-using-the-test-application-inside-the-howard-repo
…t-application-inside-the-howard-repo
except S3Error as e: | ||
print("error: S3:", e) | ||
return jsonify({"error": f"Internal server error {e}"}), 500 |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium test
Stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 27 days ago
To fix the problem, we need to ensure that the exception message is not directly exposed to the user. Instead, we should log the detailed error message on the server and return a generic error message to the user. This approach maintains the ability to debug issues using server logs while protecting the application's internal details from being exposed to users.
- Modify the exception handling block to log the detailed error message using the existing logger and return a generic error message to the user.
- Ensure that the logger is used to capture the exception details.
-
Copy modified lines R116-R117
@@ -115,3 +115,4 @@ | ||
except S3Error as e: | ||
return jsonify({"error": f"Internal server error {e}"}), 500 | ||
logger.critical(f"critical: Internal server error {e}") | ||
return jsonify({"error": "Internal server error"}), 500 | ||
|
No description provided.