-
Notifications
You must be signed in to change notification settings - Fork 180
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
fix: sanitize utils and sanitize all response code and messages #358
Conversation
Codecov Report
@@ Coverage Diff @@
## main #358 +/- ##
==========================================
- Coverage 74.60% 74.57% -0.04%
==========================================
Files 25 26 +1
Lines 2359 2407 +48
Branches 370 380 +10
==========================================
+ Hits 1760 1795 +35
- Misses 599 612 +13
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Daniel Roe <daniel@roe.dev>
// TODO: Always sanitize status message in the next major releases | ||
const originalMessage = err.statusMessage; | ||
const sanitizedMessage = sanitizeStatusMessage(err.statusMessage); | ||
if (sanitizedMessage !== originalMessage) { | ||
console.warn( | ||
"[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future `statusMessage` will be sanitized by default." | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks great to me 👌
Following up #357, this PR fixes all setters of
statusCode
andstatusMessage
with two newsanetizeStatusCode
andsanetizeStatusMessage
utils