File
Blob: src/node/_http_common.ts
| 1 | // Copyright (c) 2017-2022 Cloudflare, Inc. |
| 2 | // Licensed under the Apache 2.0 license found in the LICENSE file or at: |
| 3 | // https://opensource.org/licenses/Apache-2.0 |
| 4 | // Copyright Joyent and Node contributors. All rights reserved. MIT license. |
| 5 | |
| 6 | import { |
| 7 | _checkIsHttpToken, |
| 8 | _checkInvalidHeaderChar, |
| 9 | chunkExpression, |
| 10 | } from 'node-internal:internal_http'; |
| 11 | import { METHODS } from 'node-internal:internal_http_constants'; |
| 12 | import { kIncomingMessage } from 'node-internal:internal_http_util'; |
| 13 | export { |
| 14 | _checkIsHttpToken, |
| 15 | _checkInvalidHeaderChar, |
| 16 | chunkExpression, |
| 17 | kIncomingMessage, |
| 18 | }; |
| 19 | export const CRLF = '\r\n'; |
| 20 | export const continueExpression = /(?:^|\W)100-continue(?:$|\W)/i; |
| 21 | export const methods = METHODS; |
| 22 | // In Node.js, parsers is a FreeList instance for managing HTTP parser objects. |
| 23 | // We provide a stub with the expected properties for compatibility. |
| 24 | export const parsers = { name: 'parsers', max: 1000 }; |
| 25 | |
| 26 | export default { |
| 27 | _checkIsHttpToken, |
| 28 | _checkInvalidHeaderChar, |
| 29 | chunkExpression, |
| 30 | CRLF, |
| 31 | continueExpression, |
| 32 | methods, |
| 33 | parsers, |
| 34 | kIncomingMessage, |
| 35 | }; |