oceanprotocol / provider

REST API for provider of data services
Apache License 2.0
28 stars 38 forks source link

Fileinfo: Incorrect Content-Length #593

Closed alexcos20 closed 1 year ago

alexcos20 commented 1 year ago

Content-Length header is incorrect.

Example:

curl -X POST --header "Content-type:application/json" https://v4.provider.polygon.oceanprotocol.com/api/services/fileinfo -d '{"type": "url","url": "https://vaccovid-coronavirus-vaccine-and-treatment-tracker.p.rapidapi.com/api/npm-covid-data/", "method": "get", "headers":{"X-RapidAPI-Host": "vaccovid-coronavirus-vaccine-and-treatment-tracker.p.rapidapi.com","X-RapidAPI-Key": "REDACTED"}}'

outputs:

[{"contentLength":"","contentType":"application/json","index":0,"type":"url","valid":true}]

When calling the url:

curl -I -X HEAD --header "X-RapidAPI-Host:vaccovid-coronavirus-vaccine-and-treatment-tracker.p.rapidapi.com" --header "X-RapidAPI-Key: 1f811eb1f4msh4c465d8347c3bccp1ef1cfjsn011962fe9903" https://vaccovid-coronavirus-vaccine-and-treatment-tracker.p.rapidapi.com/api/npm-covid-data/
HTTP/2 404 
date: Tue, 17 Jan 2023 16:03:17 GMT
content-type: application/json
x-rapidapi-version: 1.2.8
x-rapidapi-region: AWS - eu-central-1
x-rapidapi-proxy-response: true
server: RapidAPI-1.2.8
curl -I -X GET --header "X-RapidAPI-Host:vaccovid-coronavirus-vaccine-and-treatment-tracker.p.rapidapi.com" --header "X-RapidAPI-Key: REDACTED" https://vaccovid-coronavirus-vaccine-and-treatment-tracker.p.rapidapi.com/api/npm-covid-data/
HTTP/2 200 
date: Tue, 17 Jan 2023 16:01:26 GMT
content-type: application/json; charset=utf-8
content-length: 130491
etag: W/"1fdbb-W2Cfi68LOWo+CDmemlT41tknlxQ"
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server-timing: cf-q-config;dur=7.0000005507609e-06
cf-cache-status: DYNAMIC
access-control-allow-origin: *
x-powered-by: Express
cf-ray: 78b04f39ca00911f-FRA
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=BUnXbzrr1BFQUdBWQ8iCE1PgQG95eZTD1D%2Bk6BDz8fXcnoFq5cIe92sP2E7siNkp5Hkwc9ToR%2FOGY0gp0LVlZ1sRrufUDfak13EAr7w706xuuwSremqWYA9FI7OqWEDC"}],"group":"cf-nel","max_age":604800}
server: RapidAPI-1.2.8
x-rapidapi-version: 1.2.8
x-rapidapi-region: AWS - eu-central-1