mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[GH-ISSUE #5242] [Bug] Dashboard 'Clear Offline' button fails with 'Unexpected end of JSON input' #4068
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#4068
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?
Originally created by @mango766 on GitHub (Mar 17, 2026).
Original GitHub issue: https://github.com/fatedier/frp/issues/5242
Bug Description
Clicking the Clear Offline button on the frps dashboard fails with the error:
This is caused by two related issues:
Backend (
pkg/util/http/handler.go): When an API handler returnsnil,MakeHTTPHandlerFuncresponds with HTTP 200 and an empty body. Per REST conventions, an empty-body response should use 204 No Content instead.Frontend (
web/frps/src/api/http.ts): Therequest()function unconditionally callsresponse.json()on any non-204 response. When the response body is empty or lacks aContent-Type: application/jsonheader, the browser throwsUnexpected end of JSON input.Notably, the frpc dashboard's
http.tsalready checksContent-Typebefore parsing JSON — the frps dashboard version was missing this same check.Steps to Reproduce
frpswith the dashboard enabledfrpcclients, then disconnect them so proxies go offlineExpected Behavior
Offline proxies should be cleared successfully with a success toast notification.
Environment
Related
This was independently reported by at least two users:
@fatedier commented on GitHub (Mar 20, 2026):
Fixed in v0.68.0.