Skip to content
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

refactor(http): rename statusCode to status_code and prevent email exposure in response #1358

Merged
merged 1 commit into from
Mar 2, 2025

Conversation

AdeGneus
Copy link
Collaborator

@AdeGneus AdeGneus commented Mar 2, 2025

Pull Request: Improve HTTP Response Format & Enhance Security in Newsletter Unsubscribe

Description

This PR introduces the following improvements:

  • Refactored error responses: Changed statusCode to status_code for consistency.
  • Enhanced security in error messages: Updated NotFoundException response to avoid exposing user emails.
  • Applied changes globally through the HttpExceptionFilter.

Related Issue

Fixes #(issue)

Type of Change

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation updates
  • style: Code style/formatting changes
  • refactor: Code refactoring
  • perf: Performance improvements
  • test: Test additions/updates
  • chore: Build process or tooling changes
  • ci: CI configuration changes
  • other:

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual tests

Test Evidence

Tested Changes:

  • Verified that all error responses now use status_code instead of statusCode.
  • Confirmed NotFoundException no longer reveals user email.
  • Unit tests updated and passing successfully.

Screenshots (if applicable)

before:
image

after:
image

Documentation Screenshots (if applicable)

Checklist

  • My code follows the project's coding style
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have included a screenshot showing all tests passing
  • I have included documentation screenshots (if applicable)

Additional Notes

  • These changes improve API consistency and enhance security.
  • No breaking changes introduced.

@AdeGneus AdeGneus self-assigned this Mar 2, 2025
@AdeGneus AdeGneus requested a review from TheCodeGhinux March 2, 2025 14:48
@AdeGneus AdeGneus merged commit 3acd2f5 into dev Mar 2, 2025
1 check passed
@AdeGneus AdeGneus deleted the feat/unsubscribe-newsletter branch March 2, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants