Commit 0e58d2e
chore: improve
* improvements
- Better validation when the Authorization header does not contain a space.
- Normalizes the decoded string once. Both the user and password must be normalized.
-- Strictly define NFC encoding as per RFC: 3.3.2.4 & 4.2.2.4 (even though it's the default):
"Normalization Rule: Unicode Normalization Form C (NFC) MUST be applied to all characters."
- Figured out what control characters are: https://tools.ietf.org/html/rfc5234#appendix-B.1
Left column and bottom right value of (Hx column):
-- http://www.asciitable.com/index/asciifull.gif
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Character_Classes
( "\0" equals "\x00" )
( try catch fails when decoded.match(...) does not return an array )
* Apply suggestions from code review
Co-authored-by: Luke Edwards <[email protected]>basic-auth example (#1711)1 parent 8f8c392 commit 0e58d2e
1 file changed
+19
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
| |||
114 | 111 | | |
115 | 112 | | |
116 | 113 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
122 | 118 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 119 | + | |
| 120 | + | |
127 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
128 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
129 | 134 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 135 | + | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
| |||
0 commit comments