Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.

Conversation

jeremy-daley-kr
Copy link

@jeremy-daley-kr jeremy-daley-kr commented Feb 24, 2023

A HEAD method does not have a body. If the content-encoding is gzip, KBHP should NOT try to unzip the response if Buffer.byteLength is zero, or else we see this:

 Error: unexpected end of file
      at Zlib.zlibOnError [as onerror] (node:zlib:190:17)
      at Zlib.callbackTrampoline (node:internal/async_hooks:130:17)
      at processChunkSync (node:zlib:456:12)
      at zlibBufferSync (node:zlib:178:12)
      at Object.syncBufferWrapper [as gunzipSync] (node:zlib:791:14)
      at /Users/redacted/Code/contrib/koa-better-http-proxy/app/steps/decorateUserRes.js:13:46
      at decorateProxyResBody (/Users/redacted/Code/contrib/koa-better-http-proxy/app/steps/decorateUserRes.js:45:22)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

@jeremy-daley-kr
Copy link
Author

@nsimmons Can you please consider merging this PR? Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant