-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
feat: warn when json validator does not find a content type in the request #3707
base: main
Are you sure you want to change the base?
Conversation
Thanks! I'll check it later. |
- Fixed a code typo that said `.get` instead of `.post` - Updated wording about "warning" in anticipation of honojs/hono#3707 - Reworded code block descriptors
- Fixed a code typo that said `.get` instead of `.post` - Updated wording about "warning" in anticipation of honojs/hono#3707 - Reworded code block descriptors
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3707 +/- ##
=======================================
Coverage 91.70% 91.70%
=======================================
Files 159 159
Lines 10158 10164 +6
Branches 2855 2870 +15
=======================================
+ Hits 9315 9321 +6
Misses 842 842
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Hi @Soviut Thank you for the PR! Do you think that we should show a similar message for |
@yusukebe Yes, let's do that. I've updated the PR to warn if the target is |
I think that this may be an option. Because a threat actor's malicious request could cause a warning to be logged to the console in a production environment. |
What is the concern with that? Wouldn't that help identify threat actors more easily if lots of warnings start showing up in logs? |
When a validator has a target 'json' it will now warn if a request is missing a
Content-Type: application/json
header.Closes honojs/middleware#841
Added some docs too honojs/website#540
The author should do the following, if applicable
bun run format:fix && bun run lint:fix
to format the code