Skip to content

Commit 9ce191d

Browse files
authored
Merge branch 'nodejs:main' into all-platform-support-rm
2 parents 81232ff + 2ccad0e commit 9ce191d

19 files changed

Lines changed: 633 additions & 531 deletions

.github/workflows/aiohttp.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout aiohttp
24-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525
with:
2626
repository: aio-libs/aiohttp
2727
- name: Checkout llhttp
28-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2929
with:
3030
path: vendor/llhttp
3131
- name: Restore node_modules cache
32-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
32+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
3333
with:
3434
path: vendor/llhttp/.npm
3535
key: ubuntu-latest-node-${{ hashFiles('vendor/llhttp/**/package-lock.json') }}
@@ -41,9 +41,9 @@ jobs:
4141
run: make
4242
working-directory: vendor/llhttp
4343
- name: Setup Python
44-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
44+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
4545
with:
46-
python-version: 3.x
46+
python-version: 3.13
4747
cache: 'pip'
4848
cache-dependency-path: 'requirements/*.txt'
4949
- name: Provision the dev env

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
echo $env:PATH >> $env:GITHUB_PATH
3131
3232
- name: Setup Node.js
33-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
33+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3434
with:
3535
node-version: 20.18.0
3636

@@ -39,13 +39,13 @@ jobs:
3939
if: runner.os == 'Linux'
4040

4141
- name: Fetch
42-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
42+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4343
with:
4444
fetch-depth: 1
4545

4646
# Skip macOS & Windows, cache there is slower
4747
- name: Restore node_modules cache for Linux
48-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
48+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
4949
with:
5050
path: ~/.npm
5151
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ jobs:
4141

4242
steps:
4343
- name: Checkout repository
44-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4545

4646
# Initializes the CodeQL tools for scanning.
4747
- name: Initialize CodeQL
48-
uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
48+
uses: github/codeql-action/init@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5
4949
with:
5050
languages: ${{ matrix.language }}
5151
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -55,7 +55,7 @@ jobs:
5555
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5656
# If this step fails, then you should remove it and run the build manually (see below)
5757
- name: Autobuild
58-
uses: github/codeql-action/autobuild@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
58+
uses: github/codeql-action/autobuild@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5
5959

6060
# ℹ️ Command-line programs to run using the OS shell.
6161
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -68,6 +68,6 @@ jobs:
6868
# ./location_of_script_within_repo/buildscript.sh
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
71+
uses: github/codeql-action/analyze@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5
7272
with:
7373
category: "/language:${{matrix.language}}"

.github/workflows/scorecards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
steps:
3333
- name: "Checkout code"
34-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3535
with:
3636
persist-credentials: false
3737

@@ -66,6 +66,6 @@ jobs:
6666

6767
# Upload the results to GitHub's code scanning dashboard.
6868
- name: "Upload to code-scanning"
69-
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
69+
uses: github/codeql-action/upload-sarif@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5
7070
with:
7171
sarif_file: results.sarif

CMakeLists.txt

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ cmake_policy(SET CMP0069 NEW)
33

44
project(llhttp VERSION _RELEASE_)
55
include(GNUInstallDirs)
6+
include(CMakePackageConfigHelpers)
67

78
set(CMAKE_C_STANDARD 99)
89

@@ -66,18 +67,6 @@ function(config_library target)
6667
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
6768
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
6869
)
69-
70-
install(FILES
71-
${CMAKE_CURRENT_SOURCE_DIR}/libllhttp.pc
72-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
73-
)
74-
75-
# This is required to work with FetchContent
76-
install(EXPORT llhttp
77-
FILE llhttp-config.cmake
78-
NAMESPACE llhttp::
79-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/llhttp
80-
)
8170
endfunction(config_library target)
8271

8372
if(LLHTTP_BUILD_SHARED_LIBS)
@@ -98,6 +87,36 @@ if(LLHTTP_BUILD_STATIC_LIBS)
9887
config_library(llhttp_static)
9988
endif()
10089

90+
if(TARGET llhttp_shared OR TARGET llhttp_static)
91+
install(FILES
92+
${CMAKE_CURRENT_SOURCE_DIR}/libllhttp.pc
93+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
94+
)
95+
96+
install(EXPORT llhttp
97+
FILE llhttp-targets.cmake
98+
NAMESPACE llhttp::
99+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/llhttp
100+
)
101+
102+
configure_package_config_file(
103+
${CMAKE_CURRENT_SOURCE_DIR}/cmake/llhttp-config.cmake.in
104+
${CMAKE_CURRENT_BINARY_DIR}/llhttp-config.cmake
105+
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/llhttp
106+
)
107+
108+
write_basic_package_version_file(
109+
${CMAKE_CURRENT_BINARY_DIR}/llhttp-config-version.cmake
110+
COMPATIBILITY AnyNewerVersion
111+
)
112+
113+
install(FILES
114+
${CMAKE_CURRENT_BINARY_DIR}/llhttp-config.cmake
115+
${CMAKE_CURRENT_BINARY_DIR}/llhttp-config-version.cmake
116+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/llhttp
117+
)
118+
endif()
119+
101120
# On windows with Visual Studio, add a debug postfix so that release
102121
# and debug libraries can coexist.
103122
if(MSVC)

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:24-alpine@sha256:e8e882c692a08878d55ec8ff6c5a4a71b3edca25eda0af4406e2a160d8a93cf2
1+
FROM node:25-alpine@sha256:809972647175c30a4c7763d3e6cc064dec588972af57e540e5a6f27442bb0845
22
ARG UID=1000
33
ARG GID=1000
44

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ build/native:
4545
release: clean generate
4646
@echo "${RELEASE}" | grep -q -E ".+" || { echo "Please make sure the RELEASE argument is set."; exit 1; }
4747
rm -rf release
48+
mkdir -p release/cmake
4849
mkdir -p release/src
4950
mkdir -p release/include
5051
cp -rf build/llhttp.h release/include/
5152
cp -rf build/c/llhttp.c release/src/
5253
cp -rf src/native/*.c release/src/
5354
cp -rf src/llhttp.gyp release/
5455
cp -rf src/common.gypi release/
56+
cp -rf cmake/llhttp-config.cmake.in release/cmake
5557
sed s/_RELEASE_/$(RELEASE)/ CMakeLists.txt > release/CMakeLists.txt
5658
cp -rf libllhttp.pc.in release/
5759
cp -rf README.md release/

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ The following callbacks can return `0` (proceed normally), `-1` (error) or `HPE_
112112
* `on_message_complete`: Invoked when a request/response has been completedly parsed.
113113
* `on_url_complete`: Invoked after the URL has been parsed.
114114
* `on_method_complete`: Invoked after the HTTP method has been parsed.
115-
* `on_protocol_complete`: Invoked after the HTTP version has been parsed.
115+
* `on_protocol_complete`: Invoked after the protocol has been parsed.
116116
* `on_version_complete`: Invoked after the HTTP version has been parsed.
117117
* `on_status_complete`: Invoked after the status code has been parsed.
118118
* `on_header_field_complete`: Invoked after a header name has been parsed.
@@ -397,6 +397,16 @@ With this flag this check is disabled.
397397
398398
**Enabling this flag can pose a security issue since you will be exposed to request smuggling attacks. USE WITH CAUTION!**
399399
400+
### `void llhttp_set_lenient_header_value_relaxed(llhttp_t* parser, int enabled)`
401+
402+
Enables/disables relaxed handling of control characters in header values.
403+
404+
Normally `llhttp` would error when header values contain characters not in the valid set (HTAB, SP, VCHAR, OBS_TEXT). With
405+
this flag, control characters (except for NULL, CR & LF) will be accepted in header values.
406+
407+
This does not create any known security issue, but does allow content considered 'invalid' by
408+
[RFC 9110](https://www.rfc-editor.org/rfc/rfc9110#name-field-values) and so should be avoided by default.
409+
400410
## Build Instructions
401411
402412
Make sure you have [Node.js](https://nodejs.org/), npm and npx installed. Then under project directory run:

cmake/llhttp-config.cmake.in

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@PACKAGE_INIT@
2+
3+
include("${CMAKE_CURRENT_LIST_DIR}/llhttp-targets.cmake")
4+
5+
if(NOT TARGET llhttp::llhttp)
6+
if(TARGET llhttp::llhttp_shared)
7+
add_library(llhttp::llhttp INTERFACE IMPORTED)
8+
set_property(TARGET llhttp::llhttp PROPERTY
9+
INTERFACE_LINK_LIBRARIES llhttp::llhttp_shared
10+
)
11+
elseif(TARGET llhttp::llhttp_static)
12+
add_library(llhttp::llhttp INTERFACE IMPORTED)
13+
set_property(TARGET llhttp::llhttp PROPERTY
14+
INTERFACE_LINK_LIBRARIES llhttp::llhttp_static
15+
)
16+
endif()
17+
endif()
18+
19+
check_required_components(llhttp)

0 commit comments

Comments
 (0)