Skip to content

Fix successful icon creation reported as failure (#17)#18

Merged
p0dalirius merged 1 commit into
mainfrom
bugfix-icon-create-201-status
Jun 22, 2026
Merged

Fix successful icon creation reported as failure (#17)#18
p0dalirius merged 1 commit into
mainfrom
bugfix-icon-create-201-status

Conversation

@p0dalirius

Copy link
Copy Markdown
Contributor

Linked Issue

Closes #17

Root Cause

The creation branch of update_icon issues a POST /api/v2/custom-nodes and then gated its success message on r.status_code == 200. The BloodHound endpoint returns 201 Created for a successful POST, so the check was always false on a real create, sending control into the failure branch and printing Failed to update custom icon ... (HTTP 201) despite the icon being registered.

Fix Description

Accept both 200 and 201 as success for the POST. The corresponding messages were also corrected to say "created" / "Failed to create" so the create branch no longer claims it "updated" the icon. No behavior changed in the PUT (update) branch, which still correctly expects 200.

How Verified

Static: the POST create path now reports success on 201, the status the create endpoint returns, and only prints the failure message on other statuses. python3 -m py_compile set-custom-icons.py passes.

Test Coverage

None: the script has no test harness and the path requires a live BloodHound API to return a real status code; the change is a status-code comparison with no other logic.

Scope of Change

  • Files changed: set-custom-icons.py
  • Submodule pointer updated: no
  • Behavioral changes outside the bug fix: none

@p0dalirius
p0dalirius merged commit 77a081b into main Jun 22, 2026
8 checks passed
@p0dalirius
p0dalirius deleted the bugfix-icon-create-201-status branch June 22, 2026 07:05
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.

set-custom-icons.py reports successful icon creation as failure

1 participant