aboutcode-org / aboutcode-org/vulnerablecode

bulk_search API returns incomplete / partial data using Chunked Transfer Encoding

未關閉
#2,120 2 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
702
分支
328
平均合併
3 天 8 小時
30 天內合併 PR
3

描述

**Scenario**

Neither with `curl`, nor with `reqests` lib (Python) nor with `OkHttp` (Kotlin) it is possible
to get the complete data of the response, for package: `pkg:maven/com.google.guava/guava@19.0`.
It seems that the server attempts to use Chunked transfer encoding.

It reproduces for both, API v1 + v2.

Note: There are other packages, for which the problem does not happen.

**Reproduce with curl**

```
curl 'https://public.vulnerablecode.io/api/packages/bulk_search' \
-H 'Content-Type: application/json; charset=utf-8' \
--data '{"purls":["pkg:maven/com.google.guava/guava@19.0"]}'
```
gives

`curl: (18) transfer closed with 64255 bytes remaining to read`

**Reproduce with Python**

```
import requests

url = 'https://public.vulnerablecode.io/api/packages/bulk_search'
myobj = {
"purls": [
"pkg:maven/com.google.guava/guava@19.0"
]
}

x = requests.post(url, json = myobj, stream=False)

print(x.text)
```

gives:

`requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(97975 bytes read, 64255 more expected)', IncompleteRead(97975 bytes read, 64255 more expected))`

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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