File tree Expand file tree Collapse file tree 1 file changed +29
-16
lines changed Expand file tree Collapse file tree 1 file changed +29
-16
lines changed Original file line number Diff line number Diff line change
1
+ import { cloneDeep } from 'es-toolkit'
1
2
import { objectsAreEqual } from './objectUtils'
2
3
import { Response } from './response'
3
4
import { timeToMs } from './time'
@@ -205,23 +206,35 @@ class PrefetchedRequests {
205
206
)
206
207
}
207
208
209
+ protected withoutPurposePrefetchHeader ( params : ActiveVisit ) : ActiveVisit {
210
+ const newParams = cloneDeep ( params )
211
+ if ( newParams . headers [ 'Purpose' ] === 'prefetch' ) {
212
+ delete newParams . headers [ 'Purpose' ]
213
+ }
214
+ return newParams
215
+ }
216
+
208
217
protected paramsAreEqual ( params1 : ActiveVisit , params2 : ActiveVisit ) : boolean {
209
- return objectsAreEqual < ActiveVisit > ( params1 , params2 , [
210
- 'showProgress' ,
211
- 'replace' ,
212
- 'prefetch' ,
213
- 'onBefore' ,
214
- 'onStart' ,
215
- 'onProgress' ,
216
- 'onFinish' ,
217
- 'onCancel' ,
218
- 'onSuccess' ,
219
- 'onError' ,
220
- 'onPrefetched' ,
221
- 'onCancelToken' ,
222
- 'onPrefetching' ,
223
- 'async' ,
224
- ] )
218
+ return objectsAreEqual < ActiveVisit > (
219
+ this . withoutPurposePrefetchHeader ( params1 ) ,
220
+ this . withoutPurposePrefetchHeader ( params2 ) ,
221
+ [
222
+ 'showProgress' ,
223
+ 'replace' ,
224
+ 'prefetch' ,
225
+ 'onBefore' ,
226
+ 'onStart' ,
227
+ 'onProgress' ,
228
+ 'onFinish' ,
229
+ 'onCancel' ,
230
+ 'onSuccess' ,
231
+ 'onError' ,
232
+ 'onPrefetched' ,
233
+ 'onCancelToken' ,
234
+ 'onPrefetching' ,
235
+ 'async' ,
236
+ ] ,
237
+ )
225
238
}
226
239
}
227
240
You can’t perform that action at this time.
0 commit comments