-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 ExecuteCallbackWithCtx
to use the context that was provided
#5236
Fix ExecuteCallbackWithCtx
to use the context that was provided
#5236
Conversation
This updates `ExecuteCallbackWithCtx` to use the context that was provided.
@tarunKoyalwar this is needed to allow for context cancellation through the SDK. |
Thanks so much for your contribution @doug-threatmate , we appreciate it! |
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.
thanks for PR and looks like i missed this , after taking a closer look , it seems like there are more hardcoded context especially when creating new RateLimiter in library, i fixed this in this branch but i am getting 403 when i push changes
@doug-threatmate @stan-threatmate , can you give push access to this PR/branch https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork
@tarunKoyalwar I don't have the button that your guide references, but I did invite you to the repo, so maybe that'll do the same thing. |
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.
lgtm !
sorry about the delay , but i have removed all hardcoded contexts in library, this required a change in two public facing functions
NewThreadSafeNucleiEngine(opts ..)
NewNucleiEngine(opts ...)
both of them are now marked as deprecated in favour of
NewThreadSafeNucleiEngineCtx(ctx context.Context,opts ..)
NewNucleiEngineCtx(ctx context.Context, opts ...)
the earlier ones will still work but using those functions is not recommended because if context is cancelled it might cause goroutine leaks
This updates
ExecuteCallbackWithCtx
to use the context that was provided.Proposed changes
Recently, context support was added in various places in Nuclei. In particular,
ExecuteCallbackWithCtx
was added to replaceExecuteCallback
. However, the context that is passed in toExecuteCallbackWithCtx
is unused.This change passes that context along to
ExecuteScanWithOpts
instead of usingcontext.Background()
.Checklist