-
Notifications
You must be signed in to change notification settings - Fork 10
Support h3 #572
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
base: main
Are you sure you want to change the base?
Support h3 #572
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
library/sources/H3.ts
Outdated
return [wrapEventHandler(args[0] as EventHandler, h3)]; | ||
} | ||
|
||
if (args[0] && typeof args[0] === "object" && !Array.isArray(args[0])) { |
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.
Use isPlainObject helper?
library/sources/H3.ts
Outdated
// Can be a function or a array of functions | ||
if (typeof config[func] === "function") { | ||
config[func] = wrapMiddleware( | ||
config[func] as (...args: unknown[]) => void | Promise<void>, |
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.
Extract type for (...args: unknown[]) => void | Promise<void>
?
library/sources/H3.ts
Outdated
} | ||
|
||
private wrapCreateApp(args: unknown[], h3: typeof import("h3")) { | ||
if (args.length < 1 || typeof args[0] !== "object" || !args[0]) { |
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.
if (args.length < 1 || typeof args[0] !== "object" || !args[0]) { | |
if (args.length === 0 || typeof args[0] !== "object" || !args[0]) { |
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.
Use isPlainObject helper?
Co-authored-by: Hans Ott <[email protected]>
Probably need install docs? |
* 'main' of github.com:AikidoSec/node-RASP: (166 commits) Let all benchmarks run even if one fails Pass `t` in function Format Add test case for use case Revert "Add more test cases" Add more test cases Speed up safeDecodeURIComponent unit tests Allow access to route if exact match does Rename variable to make it more clear Remove redundant methods Improve comment Remove `isMonitoredIPAddress` Use userAgent variable Iterate through monitored IP lists only once Add comment about empty string and regexp Refactor safeCreateRegExp to its own file Fix end2end test Fix missing imports Format file Add end2end test to ensure monitored IPs and user agents are never blocked ...
}; | ||
|
||
// eslint-disable-next-line camelcase | ||
handler.__is_handler__ = true; |
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.
Not sure why this is added? Can't find this in h3 codebase?
Wouldn't it be okay to require something from h3 so that we don't have to do this?
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.
Only on mobile right now, but it was added in H3 codebase. Importing is always a bit problematic with bundlers, no?
if (!(key in object)) { | ||
object[key] = value; | ||
return; | ||
} |
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.
prototype pollution?
@@ -8,4 +8,4 @@ Try the following URLs: | |||
|
|||
- http://localhost:4000/ : List all cats | |||
- http://localhost:4000/?petname=Kitty : This will add a new cat named "Kitty" | |||
- http://localhost:4000/?petname=Kitty'); DELETE FROM cats;-- H : This will delete all cats | |||
- http://localhost:4000/?petname=Kitty'); DELETE FROM cats_3;-- H : This will delete all cats |
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.
We modified the wrong one?
Co-authored-by: Hans Ott <[email protected]>
https://h3.unjs.io
https://www.npmjs.com/package/h3