Allow any format for X-Request-Id

未關閉 適合新手
#1,337 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
65/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
python
領域
api, backend

研究方向

這個 issue 出在 starlette-context 的請求 ID 驗證上。查看連結的測試檔案以了解 UUID 驗證。找到 starlette-context 在 llama-cpp-python 伺服器程式碼中的整合位置,可能在 middleware 設定附近。修改驗證邏輯,使其接受 X-Request-Id 的任何字串格式,而不只是 UUID。透過傳送帶有非 UUID X-Request-Id header 的請求進行測試,並確保回應為 200。

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

描述

enhancement

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest code. Development is very rapid so there are no tagged versions as of now.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new bug or useful enhancement to share.

Expected Behavior

Normal response (200)

Current Behavior

400, Bad request

Environment and Context

Huggingface spaces docker

Failure Information (for bugs)

Feature introduced in https://github.com/abetlen/llama-cpp-python/pull/703, Huggingface Spaces already has x-request-id in the request, but it was not a valid uuid that starlette-context expected (https://github.com/tomwojcik/starlette-context/blob/992ab9401a9f557994379053fbd98471c601eda9/tests/test_plugins/test_request_id.py#L37), resulting in the server returning bad request 400.

主要語言
Python
星號
10.6k
分支
1.5k
平均合併
23 分鐘
30 天內合併 PR
1

貢獻指南

開啟貢獻指南

從這裡開始

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

abetlen/llama-cpp-python 的其他 Issue

查看 abetlen/llama-cpp-python 的全部 Issue

相似的 Issue

更多 Python Issue

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

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