mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[PR #5162] [CLOSED] Fix Clear Offline button: return 204 No Content for nil API responses #5152
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#5152
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fatedier/frp/pull/5162
Author: @Copilot
Created: 2/6/2026
Status: ❌ Closed
Base:
dev← Head:copilot/investigate-issue-5160📝 Commits (4)
c227b6aInitial plane2ce728Fix Clear Offline button: return 204 No Content for nil API responses6692dacFinal status update3115399Revert accidental package-lock.json changes from CodeQL scan📊 Changes
2 files changed (+71 additions, -1 deletions)
View changed files
📝
pkg/util/http/handler.go(+1 -1)➕
pkg/util/http/handler_test.go(+70 -0)📄 Description
WHY
The "Clear Offline" button in the server dashboard fails with
"Failed to execute 'json' on 'Response': Unexpected end of JSON input".DeleteProxiesreturns(nil, nil)→MakeHTTPHandlerFuncsends 200 with empty body → frontend callsresponse.json()on empty body → parse error.Fix: Return
204 No Contentinstead of200 OKwhen the handler result is nil. The frontend already handles 204 correctly:pkg/util/http/handler.go—StatusOK→StatusNoContentfor nil responsespkg/util/http/handler_test.go— tests for nil, struct, and error response paths💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.