@@ -126,39 +126,44 @@ func WithConcurrency(opts Concurrency) NucleiSDKOptions {
126
126
// minimum required is 1
127
127
if opts .TemplateConcurrency <= 0 {
128
128
return errors .New ("template threads must be at least 1" )
129
- } else {
130
- e .opts .TemplateThreads = opts .TemplateConcurrency
131
129
}
132
130
if opts .HostConcurrency <= 0 {
133
131
return errors .New ("host concurrency must be at least 1" )
134
- } else {
135
- e .opts .BulkSize = opts .HostConcurrency
136
132
}
137
133
if opts .HeadlessHostConcurrency <= 0 {
138
134
return errors .New ("headless host concurrency must be at least 1" )
139
- } else {
140
- e .opts .HeadlessBulkSize = opts .HeadlessHostConcurrency
141
135
}
142
136
if opts .HeadlessTemplateConcurrency <= 0 {
143
137
return errors .New ("headless template threads must be at least 1" )
144
- } else {
145
- e .opts .HeadlessTemplateThreads = opts .HeadlessTemplateConcurrency
146
138
}
147
139
if opts .JavascriptTemplateConcurrency <= 0 {
148
140
return errors .New ("js must be at least 1" )
149
- } else {
150
- e .opts .JsConcurrency = opts .JavascriptTemplateConcurrency
151
141
}
152
142
if opts .TemplatePayloadConcurrency <= 0 {
153
143
return errors .New ("payload concurrency must be at least 1" )
154
- } else {
155
- e .opts .PayloadConcurrency = opts .TemplatePayloadConcurrency
156
144
}
157
145
if opts .ProbeConcurrency <= 0 {
158
146
return errors .New ("probe concurrency must be at least 1" )
159
- } else {
160
- e .opts .ProbeConcurrency = opts .ProbeConcurrency
161
147
}
148
+ e .opts .TemplateThreads = opts .TemplateConcurrency
149
+ e .opts .BulkSize = opts .HostConcurrency
150
+ e .opts .HeadlessBulkSize = opts .HeadlessHostConcurrency
151
+ e .opts .HeadlessTemplateThreads = opts .HeadlessTemplateConcurrency
152
+ e .opts .JsConcurrency = opts .JavascriptTemplateConcurrency
153
+ e .opts .PayloadConcurrency = opts .TemplatePayloadConcurrency
154
+ e .opts .ProbeConcurrency = opts .ProbeConcurrency
155
+ return nil
156
+ }
157
+ }
158
+
159
+ // WithResponseReadSize sets the maximum size of response to read in bytes.
160
+ // A value of 0 means no limit. Recommended values: 1MB (1048576) to 10MB (10485760).
161
+ func WithResponseReadSize (responseReadSize int ) NucleiSDKOptions {
162
+ return func (e * NucleiEngine ) error {
163
+ if responseReadSize < 0 {
164
+ return errors .New ("response read size must be non-negative" )
165
+ }
166
+ e .opts .ResponseReadSize = responseReadSize
162
167
return nil
163
168
}
164
169
}
0 commit comments