[PR #2822] [CLOSED] debug: add /debug/http-routes endpoint #2883

Closed
opened 2025-12-29 04:19:29 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2822
Author: @kradalby
Created: 10/27/2025
Status: Closed

Base: mainHead: kradalby/debug-http-route


📝 Commits (1)

  • 733fc40 debug: add /debug/http-routes endpoint

📊 Changes

3 files changed (+187 additions, -2 deletions)

View changed files

📝 hscontrol/app.go (+1 -1)
📝 hscontrol/debug.go (+124 -1)
hscontrol/debug_test.go (+62 -0)

📄 Description

Add new debug endpoint to list all registered HTTP routes with their methods and optional names. This helps with debugging and understanding the API surface area.

The endpoint supports both text and JSON formats:

Text format (default):

=== Registered HTTP Routes ===

/api/v1/                                          [ALL]
/apple                                            [GET]
/health                                           [GET]
/register/{registration_id}                       [GET]
/ts2021                                           [POST, GET]

Total routes: 14

JSON format:

{
  "routes": [
    {
      "path": "/health",
      "methods": ["GET"]
    },
    {
      "path": "/ts2021",
      "methods": ["POST", "GET"]
    }
  ],
  "total_count": 14
}

claude was used in this PR.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/2822 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 10/27/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `kradalby/debug-http-route` --- ### 📝 Commits (1) - [`733fc40`](https://github.com/juanfont/headscale/commit/733fc40c3d9f4ae983f38f9f2e4fc9983fe81ef4) debug: add /debug/http-routes endpoint ### 📊 Changes **3 files changed** (+187 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `hscontrol/app.go` (+1 -1) 📝 `hscontrol/debug.go` (+124 -1) ➕ `hscontrol/debug_test.go` (+62 -0) </details> ### 📄 Description Add new debug endpoint to list all registered HTTP routes with their methods and optional names. This helps with debugging and understanding the API surface area. The endpoint supports both text and JSON formats: Text format (default): ``` === Registered HTTP Routes === /api/v1/ [ALL] /apple [GET] /health [GET] /register/{registration_id} [GET] /ts2021 [POST, GET] Total routes: 14 ``` JSON format: ```json { "routes": [ { "path": "/health", "methods": ["GET"] }, { "path": "/ts2021", "methods": ["POST", "GET"] } ], "total_count": 14 } ``` claude was used in this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 04:19:29 +01:00
adam closed this issue 2025-12-29 04:19:29 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2883