@@ -317,47 +317,6 @@ function sameOrigin (A, B) {
317
317
return false
318
318
}
319
319
320
- // https://fetch.spec.whatwg.org/#corb-check
321
- function CORBCheck ( request , response ) {
322
- // 1. If request’s initiator is "download", then return allowed.
323
- if ( request . initiator === 'download' ) {
324
- return 'allowed'
325
- }
326
-
327
- // 2. If request’s current URL’s scheme is not an HTTP(S) scheme, then return allowed.
328
- if ( ! / ^ h t t p s ? $ / . test ( request . currentURL . scheme ) ) {
329
- return 'allowed'
330
- }
331
-
332
- // 3. Let mimeType be the result of extracting a MIME type from response’s header list.
333
- const mimeType = response . headersList . get ( 'content-type' )
334
-
335
- // 4. If mimeType is failure, then return allowed.
336
- if ( mimeType === '' ) {
337
- return 'allowed'
338
- }
339
-
340
- // 5. If response’s status is 206 and mimeType is a CORB-protected MIME type, then return blocked.
341
-
342
- const isCORBProtectedMIME =
343
- ( / ^ t e x t \/ h t m l \b / . test ( mimeType ) ||
344
- / ^ a p p l i c a t i o n \/ j a v a s c r i p t \b / . test ( mimeType ) ||
345
- / ^ a p p l i c a t i o n \/ x m l \b / . test ( mimeType ) ) && ! / ^ a p p l i c a t i o n \/ x m l \+ s v g \b / . test ( mimeType )
346
-
347
- if ( response . status === 206 && isCORBProtectedMIME ) {
348
- return 'blocked'
349
- }
350
-
351
- // 6. If determine nosniff with response’s header list is true and mimeType is a CORB-protected MIME type or its essence is "text/plain", then return blocked.
352
- // https://fetch.spec.whatwg.org/#determinenosniff
353
- if ( response . headersList . get ( 'x-content-type-options' ) && isCORBProtectedMIME ) {
354
- return 'blocked'
355
- }
356
-
357
- // 7. Return allowed.
358
- return 'allowed'
359
- }
360
-
361
320
function createDeferredPromise ( ) {
362
321
let res
363
322
let rej
@@ -430,7 +389,6 @@ module.exports = {
430
389
isFileLike,
431
390
isValidReasonPhrase,
432
391
sameOrigin,
433
- CORBCheck,
434
392
normalizeMethod,
435
393
serializeJavascriptValueToJSONString
436
394
}
0 commit comments