mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6317] [Bug]: Client HWIDS API doesn`t response #4290
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4290
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 @kerya2 on GitHub (Aug 25, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6317
Describe the bug
If I ask API about client
s hwids it doesnt response, but if I ask API about client it response.How to reproduce the problem
Just ask API /panel/api/clients/hwid/{email}
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.7.0
Xray-core version
26.7.28
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 22.04.5 LTS x86_64
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Aug 25, 2026):
The endpoint you called does not exist: the path is
hwids(plural), nothwid, and it is a POST, not a GET. That is why you get "no response" — an unmatched/panel/api/...path is terminated byc.AbortWithStatus(http.StatusNotFound)ininternal/web/web.go:278, which writes a bare 404 with an empty body, so a client that only prints the body shows nothing.The three HWID routes, registered in
internal/web/controller/client.go:79-81:Under the
/panel/api/clientsgroup (internal/web/controller/api.go:182) that resolves toPOST /panel/api/clients/hwids/{email}. Working call, with a Bearer token from Settings → Security → API Token:Three more things that produce the same empty-body symptom, so you can rule them out:
gin.Default()(internal/web/web.go:164), soHandleMethodNotAllowedis off — aGETon/clients/hwids/{email}also falls through to the same empty 404 instead of a 405.checkAPIAuthanswers an unauthenticated request withc.AbortWithStatus(http.StatusNotFound)unless the caller sendsX-Requested-With: XMLHttpRequest(internal/web/controller/api.go:63-69) — again an empty 404, not a JSON error.CSRFMiddlewareaborts unsafe methods with an empty 403 (internal/web/middleware/security.go:51-53). ABearertoken setsapi_authedand skips that check entirely (security.go:43-46), which is why token auth is the simpler path for scripts.Once you hit the right route, note that
objcan legitimately benull:ListClientHwidsreturns early when the client has nosubId(internal/web/service/client_hwid.go:164-167), and rows are only created when the client actually fetches its subscription with HWID headers andlimitHwid > 0(EnforceHwidForSubID,client_hwid.go:92-95). A client that has never used a HWID-capable app has an empty list.The endpoints are documented at
POST /panel/api/clients/hwids/:emailinfrontend/src/pages/api-docs/endpoints.ts:1202-1207and in the panel's own API Docs page (/panel/api-docs); nothing in the repository ever exposed a singularclients/hwid/path.Closing as a configuration/usage issue and relabelling from
bugtoquestion. If the plural POST form above still returns nothing for you, please reply with the exact command and the HTTP status code (curl -i) and this can be reopened.Verdict: Not a bug (user configuration)
Severity: N/A
Confidence: High
Root cause: No defect. The requested path
/panel/api/clients/hwid/{email}is not registered; the routes arePOST|DELETE /panel/api/clients/hwids/:email(internal/web/controller/client.go:79-81). The empty response isengine.NoRoute→c.AbortWithStatus(http.StatusNotFound)atinternal/web/web.go:278, which emits no body.Already fixed: Not applicable — 3.7.0 is the current release (
gh release list), and the routes are unchanged since1250fbb7"feat(clients): allow removing a single HWID device (#6265)" /694ad6de"feat(sub): add per-client subscription HWID limits (#5802)".Duplicate of: None
Evidence:
internal/web/controller/client.go:79g.POST("/hwids/:email", a.getHwids);internal/web/controller/api.go:182clients := api.Group("/clients");internal/web/web.go:278c.AbortWithStatus(http.StatusNotFound);internal/web/controller/spa.go:108-110excludes/panel/api/from the SPA fallback, so API misses get the bare 404;internal/web/web.go:164engine := gin.Default()(noHandleMethodNotAllowed);internal/web/middleware/security.go:43-53(Bearer skips CSRF, otherwise empty 403);internal/web/service/client_hwid.go:164-167returnsnil, nilwhensubID == "";frontend/src/hooks/useClientHwids.ts:22-24— the panel UI itself POSTs to/panel/api/clients/hwids/${email};frontend/src/pages/api-docs/endpoints.ts:1202-1224, pinned both ways byTestRouteRegistryContract(internal/web/routes_contract_test.go:109). A repo-wide grep forclients/hwidnot followed bysreturns no route or doc.Not determined: Whether the reporter literally sent the singular path or mistyped it in the report; a
curl -iagainstPOST /panel/api/clients/hwids/{email}with the status line would settle it.This reply was generated automatically; a maintainer may follow up.