fergusstrange / embedded-postgres

Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test
MIT License
817 stars 84 forks source link

Jar unzip fails when server does not set ContentLength #123

Closed djcass44 closed 10 months ago

djcass44 commented 1 year ago

In my environment we are behind a corporate proxy and have to pull Jars through a cache service (think Artifactory or Nexus). This service returns data using chunked encoding and therefore doesn't set the Content-Length header.

This library depends on ContentLength being set. If not set, Go sets it to -1 which causes the zip.NewReader call to fail instantly.

It should be easily fixable by simply using len(bodyBytes) when contentLength < 0. I will open an MR alongside this issue.

fergusstrange commented 10 months ago

Released with v1.25.0