Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Not easy to get the number of methods llhttp has

未關閉
#872 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 6 天內回覆

@official-burak 已經在處理了。

開始於 2026年9月2日。

  • #880 來自 @official-burak —— 未關閉

評估

難度
3/5
預估耗時
1-2 天
新手友好度
54/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
冷清
技術堆疊
c, typescript
領域
api, backend

研究方向

從 api.c:222 開始,追蹤 llhttp_method_name 如何處理方法 ID,以及支援的方法表是如何定義的。檢視現有 API 和 issue 中連結的 aiohttp 範例,然後判斷哪種列舉行為是適當的。完成的標準是:呼叫端無需硬編碼數量或中止查找,即可發現每個受支援的方法,包括新加入的方法。

由索引模型根據 Issue 內容生成。

描述

In aiohttp, we need to create an array of all the method names that llhttp supports for caching purposes.

The problem is that llhttp_method_name abort()s on an out-of-range id (api.c:222), our old code therefore just had a hardcoded constant set to 46 and iterated over them. But, this means when llhttp added the QUERY method, our code didn't pick it up.

Would it be reasonable to add something to llhttp to trivially get this information? Either allowing llhttp_method_name to return NULL rather than abort(), or adding a constant that tells us how many methods are available.

Without something like that, I've had to add this awkward thing to extract the names directly:
https://github.com/aio-libs/aiohttp/pull/13174/changes#diff-061b5abe803b659aa544700e4065e1fbff6e83112315e345ea2d2e31ad1d6ca7R106-R117

主要語言
TypeScript
星號
2k
分支
236
平均合併
5 天 2 小時
30 天內合併 PR
1

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

nodejs/llhttp 的其他 Issue

查看 nodejs/llhttp 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。