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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.13.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.13.0) - 2026-04-05

### Added — http-request

- `readIncomingResponse()` — reads and buffers a Node.js `IncomingResponse` into an `HttpResponse` (#143)
- Useful for converting raw responses from code that bypasses `httpRequest()` (e.g. multipart form-data uploads) into the standard `HttpResponse` interface
- `IncomingResponse` type alias — disambiguates `IncomingMessage` as a client-side response
- `IncomingRequest` type alias — disambiguates `IncomingMessage` as a server-side request

### Changed — http-request

- Internal `httpRequestAttempt` callbacks now use `IncomingResponse` type
- `HttpResponse.rawResponse` type narrowed from `IncomingMessage` to `IncomingResponse`

## [5.12.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.12.0) - 2026-04-04

### Added — http-request
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@socketsecurity/lib",
"version": "5.12.0",
"version": "5.13.0",
"packageManager": "pnpm@10.33.0",
"license": "MIT",
"description": "Core utilities and infrastructure for Socket.dev security tools",
Expand Down
5 changes: 4 additions & 1 deletion test/unit/http-request.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2149,7 +2149,10 @@ abc123def456789012345678901234567890123456789012345678901234abcd
expect(response.ok).toBe(true)
expect(response.status).toBe(200)
expect(response.statusText).toBe('OK')
expect(response.json()).toEqual({ message: 'Hello, World!', status: 'success' })
expect(response.json()).toEqual({
message: 'Hello, World!',
status: 'success',
})
expect(response.headers['content-type']).toBe('application/json')
expect(response.rawResponse).toBe(msg)
})
Expand Down