Skip to content

Commit ac174e5

Browse files
committed
chore: bump version to 5.6.0
1 parent 540d187 commit ac174e5

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,37 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [5.6.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.6.0) - 2026-02-08
9+
10+
### Added
11+
12+
- **http-request**: Added automatic default headers for JSON and text requests
13+
- `httpJson()` now automatically sets `Accept: application/json` header
14+
- `httpJson()` automatically sets `Content-Type: application/json` when body is present
15+
- `httpText()` now automatically sets `Accept: text/plain` header
16+
- `httpText()` automatically sets `Content-Type: text/plain` when body is present
17+
- User-provided headers always override defaults
18+
- Simplifies API usage - no need to manually set common headers
19+
20+
### Changed
21+
22+
- **http-request**: Renamed HTTP helper functions to support all HTTP methods (BREAKING CHANGE)
23+
- `httpGetJson()``httpJson()` - Now supports GET, POST, PUT, DELETE, PATCH, etc.
24+
- `httpGetText()``httpText()` - Now supports all HTTP methods via `method` option
25+
- Functions now accept `method` parameter in options (defaults to 'GET')
26+
- More flexible API that matches modern fetch-style conventions
27+
- **Migration**: Replace `httpGetJson()` calls with `httpJson()` and `httpGetText()` with `httpText()`
28+
29+
### Fixed
30+
31+
- **http-request**: Fixed Content-Type header incorrectly sent with empty string body
32+
- Empty string body (`""`) no longer triggers Content-Type header
33+
- Changed condition from `if (body !== undefined)` to `if (body)` for semantic correctness
34+
- Empty string represents "no content" and should not declare a Content-Type
35+
- Affects `httpJson()` and `httpText()` functions
36+
- Fixes potential API compatibility issues with servers expecting no Content-Type for empty bodies
37+
- Added comprehensive test coverage for empty string edge case
38+
839
## [5.5.3](https://github.com/SocketDev/socket-lib/releases/tag/v5.5.3) - 2026-01-20
940

1041
### Fixed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@socketsecurity/lib",
3-
"version": "5.5.3",
3+
"version": "5.6.0",
44
"packageManager": "pnpm@10.28.0",
55
"license": "MIT",
66
"description": "Core utilities and infrastructure for Socket.dev security tools",

0 commit comments

Comments
 (0)