Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ This driver uses semantic versioning:

### Fixed

- Fixed a JSON Parse error: Unexpected EOF occurring in the Bun runtime when using
`documentExists`, `vertexExists`, or `edgeExists`. The driver now correctly skips
response body parsing for HEAD requests, which must not include a body per RFC 7231.
This fix also applies to all HEAD requests made via Route.head(), ensuring consistent
behavior and compatibility across all fetch implementations.
([#821](https://github.com/arangodb/arangojs/issues/821))

- Fixed `ECONNRESET` errors in NextJS 15 production builds when using `next/cookies`
by explicitly setting the `Content-Length` header for all fixed-size request bodies.
The driver now calculates and sets `Content-Length` for strings (JSON and plain text),
Expand Down
4 changes: 3 additions & 1 deletion src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,9 @@ export class Connection {
}
throw new errors.HttpError(res);
}
if (res.body) {
// Per RFC 7231, HEAD responses must not include a body
// Skip body parsing for non-error HEAD responses to ensure cross-runtime compatibility
if (res.body && task.options.method !== "HEAD") {
if (task.options.expectBinary) {
res.parsedBody = await res.blob();
} else if (contentType?.match(MIME_JSON)) {
Expand Down