| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1282f7f commit 908f4fa
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3660,9 +3660,9 @@ const { validateHeaderName } = require('node:http'); | |||
| 3660 | 3660 | try { | |
| 3661 | 3661 | validateHeaderName(''); | |
| 3662 | 3662 | } catch (err) { | |
| 3663 | - err instanceof TypeError; // --> true | ||
| 3664 | - err.code; // --> 'ERR_INVALID_HTTP_TOKEN' | ||
| 3665 | - err.message; // --> 'Header name must be a valid HTTP token [""]' | ||
| 3663 | + console.error(err instanceof TypeError); // --> true | ||
| 3664 | + console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN' | ||
| 3665 | + console.error(err.message); // --> 'Header name must be a valid HTTP token [""]' | ||
| 3666 | 3666 | } | |
| 3667 | 3667 | ``` | |
| 3668 | 3668 | ||
@@ -3694,17 +3694,17 @@ const { validateHeaderValue } = require('node:http'); | |||
| 3694 | 3694 | try { | |
| 3695 | 3695 | validateHeaderValue('x-my-header', undefined); | |
| 3696 | 3696 | } catch (err) { | |
| 3697 | - err instanceof TypeError; // --> true | ||
| 3698 | - err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'; // --> true | ||
| 3699 | - err.message; // --> 'Invalid value "undefined" for header "x-my-header"' | ||
| 3697 | + console.error(err instanceof TypeError); // --> true | ||
| 3698 | + console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true | ||
| 3699 | + console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"' | ||
| 3700 | 3700 | } | |
| 3701 | 3701 | ||
| 3702 | 3702 | try { | |
| 3703 | 3703 | validateHeaderValue('x-my-header', 'oʊmɪɡə'); | |
| 3704 | 3704 | } catch (err) { | |
| 3705 | - err instanceof TypeError; // --> true | ||
| 3706 | - err.code === 'ERR_INVALID_CHAR'; // --> true | ||
| 3707 | - err.message; // --> 'Invalid character in header content ["x-my-header"]' | ||
| 3705 | + console.error(err instanceof TypeError); // --> true | ||
| 3706 | + console.error(err.code === 'ERR_INVALID_CHAR'); // --> true | ||
| 3707 | + console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]' | ||
| 3708 | 3708 | } | |
| 3709 | 3709 | ``` | |
| 3710 | 3710 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments