Skip to content
File

Blob: src/node/_http_common.ts

typescript36 lines
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 
6import {
7 _checkIsHttpToken,
8 _checkInvalidHeaderChar,
9 chunkExpression,
10} from 'node-internal:internal_http';
11import { METHODS } from 'node-internal:internal_http_constants';
12import { kIncomingMessage } from 'node-internal:internal_http_util';
13export {
14 _checkIsHttpToken,
15 _checkInvalidHeaderChar,
16 chunkExpression,
17 kIncomingMessage,
18};
19export const CRLF = '\r\n';
20export const continueExpression = /(?:^|\W)100-continue(?:$|\W)/i;
21export 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.
24export const parsers = { name: 'parsers', max: 1000 };
25 
26export default {
27 _checkIsHttpToken,
28 _checkInvalidHeaderChar,
29 chunkExpression,
30 CRLF,
31 continueExpression,
32 methods,
33 parsers,
34 kIncomingMessage,
35};