| 14883 | } |
| 14884 | __name(toArrayBuffer, "toArrayBuffer"); |
| 14885 | function isValidSubprotocol(protocol) { |
| 14886 | if (protocol.length === 0) { |
| 14887 | return false; |
| 14888 | } |
| 14889 | for (let i = 0; i < protocol.length; ++i) { |
| 14890 | const code = protocol.charCodeAt(i); |
| 14891 | if (code < 33 || // CTL, contains SP (0x20) and HT (0x09) |
| 14892 | code > 126 || code === 34 || // " |
| 14893 | code === 40 || // ( |
| 14894 | code === 41 || // ) |
| 14895 | code === 44 || // , |
| 14896 | code === 47 || // / |
| 14897 | code === 58 || // : |
| 14898 | code === 59 || // ; |
| 14899 | code === 60 || // < |
| 14900 | code === 61 || // = |
| 14901 | code === 62 || // > |
| 14902 | code === 63 || // ? |
| 14903 | code === 64 || // @ |
| 14904 | code === 91 || // [ |
| 14905 | code === 92 || // \ |
| 14906 | code === 93 || // ] |
| 14907 | code === 123 || // { |
| 14908 | code === 125) { |
| 14909 | return false; |
| 14910 | } |
| 14911 | } |
| 14912 | return true; |
| 14913 | } |
| 14914 | __name(isValidSubprotocol, "isValidSubprotocol"); |
| 14915 | function isValidStatusCode(code) { |
| 14916 | if (code >= 1e3 && code < 1015) { |