CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
security-normalization.test.js40 linesDownload Raw Back to test
1'use strict'2 3const test = require('tape')4const fastURI = require('..')5 6test('parse preserves reserved path escapes as data', (t) => {7  const components = fastURI.parse('http://example.com/a%2Fb/public/%2e%2e/admin')8 9  t.equal(components.path, '/a%2Fb/public/%2E%2E/admin')10  t.end()11})12 13test('normalize preserves percent-encoded path separators and dot segments', (t) => {14  t.equal(15    fastURI.normalize('http://example.com/public/%2e%2e/admin'),16    'http://example.com/public/%2E%2E/admin'17  )18 19  t.equal(20    fastURI.normalize('http://example.com/a%2Fb'),21    'http://example.com/a%2Fb'22  )23 24  t.end()25})26 27test('equal does not treat reserved path escapes as live path syntax', (t) => {28  t.equal(29    fastURI.equal('http://example.com/public/%2e%2e/admin', 'http://example.com/admin', {}),30    false31  )32 33  t.equal(34    fastURI.equal('http://example.com/a%2Fb', 'http://example.com/a/b', {}),35    false36  )37 38  t.end()39})40 
basant307/AI_Governance_Project · CoolFace