Skip to content

GPHDRUI-427: Fix GET requests sending a stray "null" body under axios… - #168

Merged
thomashilz merged 1 commit into
InterNetX:masterfrom
thomashilz:GPHDRUI-427
Jul 23, 2026
Merged

GPHDRUI-427: Fix GET requests sending a stray "null" body under axios…#168
thomashilz merged 1 commit into
InterNetX:masterfrom
thomashilz:GPHDRUI-427

Conversation

@thomashilz

Copy link
Copy Markdown
Collaborator

… 1.x

sendRequest() defaulted data to null and always attached it to the axios request config. With axios 1.18.1 (bumped from 0.x in a prior commit) and the forced Content-Type: application/json default header, this caused axios to serialize the null default into a literal "null" body on every GET request, which some APIs (e.g. account-json-server) reject as an invalid top-level JSON value.

data is now only attached to the request when it is not null, and sendGetRequest() accepts an optional body for callers that need one.

… 1.x

sendRequest() defaulted `data` to `null` and always attached it to the
axios request config. With axios 1.18.1 (bumped from 0.x in a prior
commit) and the forced Content-Type: application/json default header,
this caused axios to serialize the null default into a literal "null"
body on every GET request, which some APIs (e.g. account-json-server)
reject as an invalid top-level JSON value.

`data` is now only attached to the request when it is not `null`, and
sendGetRequest() accepts an optional body for callers that need one.
@thomashilz
thomashilz merged commit 1c8c8ce into InterNetX:master Jul 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant