| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6063a4a commit 31dea5c
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | + const http = require('http'); | ||
| 5 | + | ||
| 6 | + const expectedError = /^TypeError: Request path contains unescaped characters$/; | ||
| 7 | + const theExperimentallyDeterminedNumber = 39; | ||
| 8 | + | ||
| 9 | + function fail(path) { | ||
| 10 | + assert.throws(() => { | ||
| 11 | + http.request({ path }, common.fail); | ||
| 12 | + }, expectedError); | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + for (let i = 0; i <= theExperimentallyDeterminedNumber; i++) { | ||
| 16 | + const prefix = 'a'.repeat(i); | ||
| 17 | + for (let i = 0; i <= 32; i++) { | ||
| 18 | + fail(prefix + String.fromCodePoint(i)); | ||
| 19 | + } | ||
| 20 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments