serpapi / serpapi-javascript

Scrape and parse search engine results using SerpApi.
https://serpapi.com
MIT License
45 stars 4 forks source link

Handle HTTP chunking across multi-byte boundaries #23

Closed Freaky closed 4 months ago

Freaky commented 4 months ago

When a response contains multi-byte UTF-8 characters that cross chunk boundaries, appending the two halves to the intermediate string results in two Unicode Replacement Characters being inserted instead of the two halves being joined.

Use StringDecoder to buffer the partial characters across chunks.

Resolves #22

Freaky commented 4 months ago

CI failures look to be a result of https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/

Instructing it to use OpenSSL's doesn't appear to help, hmm.

zyc9012 commented 4 months ago

Thank you @Freaky. I fixed the CI and squashed my commit with yours.