Skip to content

fix: preserve active firmware image URL when API keys are enabled#863

Merged
tavdog merged 1 commit into
tronbyt:mainfrom
JCBird1012:websocket-ota-url-fix
Jul 21, 2026
Merged

fix: preserve active firmware image URL when API keys are enabled#863
tavdog merged 1 commit into
tronbyt:mainfrom
JCBird1012:websocket-ota-url-fix

Conversation

@JCBird1012

@JCBird1012 JCBird1012 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

The device update page was replacing the firmware-reported image URL with a generated HTTP /next URL whenever RequireAPIKey was enabled. That meant devices currently using WebSocket URLs could get pushed back to HTTP after syncing firmware settings or running an OTA update.

This fix keeps the URL reported by the device and only append the API key to it.

Summary by CodeRabbit

  • Bug Fixes
    • Improved firmware image URL handling when API key protection is enabled.
    • Preserved existing firmware image URLs while securely appending the device API key.

The device update page was replacing the firmware-reported image URL with a generated HTTP /next URL whenever RequireAPIKey was enabled. That meant devices currently using WebSocket URLs could get pushed back
to HTTP after syncing firmware settings or running an OTA flow. Keep the URL reported by the device and only append the API key to it.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8450a802-e6d2-4244-89d7-5f14011c6899

📥 Commits

Reviewing files that changed from the base of the PR and between 767e0bd and 290c823.

📒 Files selected for processing (1)
  • internal/server/handlers_device.go

📝 Walkthrough

Walkthrough

The device update page now preserves the existing firmware image URL when API-key protection is enabled and appends the device API key instead of regenerating the URL.

Changes

Device update rendering

Layer / File(s) Summary
Preserve and augment firmware image URL
internal/server/handlers_device.go
API-key-protected devices retain the existing firmwareImgURL, then append the device API key to it.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main fix: preserving the firmware image URL when API keys are enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tavdog
tavdog merged commit 4765dc3 into tronbyt:main Jul 21, 2026
7 checks 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.

2 participants