File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -218,8 +218,9 @@ class REST extends Helper {
218218 }
219219 }
220220
221- if ( this . options . onRequest ) {
222- await this . options . onRequest ( request )
221+ const onRequest = this . options . onRequest || this . config . onRequest
222+ if ( onRequest ) {
223+ await onRequest ( request )
223224 }
224225
225226 try {
@@ -248,8 +249,9 @@ class REST extends Helper {
248249 }
249250 response = err . response
250251 }
251- if ( this . options . onResponse ) {
252- await this . options . onResponse ( response )
252+ const onResponse = this . options . onResponse || this . config . onResponse
253+ if ( onResponse ) {
254+ await onResponse ( response )
253255 }
254256 try {
255257 this . options . prettyPrintJson ? this . debugSection ( 'Response' , beautify ( JSON . stringify ( response . data ) ) ) : this . debugSection ( 'Response' , JSON . stringify ( response . data ) )
You can’t perform that action at this time.
0 commit comments