[PR #5207] [MERGED] server/proxy: simplify HTTP proxy domain registration by removing duplicate loop #5173

Closed
opened 2026-05-05 14:56:04 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/5207
Author: @fatedier
Created: 3/6/2026
Status: Merged
Merged: 3/6/2026
Merged by: @fatedier

Base: devHead: new


📝 Commits (1)

  • fda83a8 server/proxy: simplify HTTP proxy domain registration by removing duplicate loop

📊 Changes

1 file changed (+10 additions, -40 deletions)

View changed files

📝 server/proxy/http.go (+10 -40)

📄 Description

Summary

  • Consolidate two nearly identical loop blocks in HTTPProxy.Run() (custom domains + subdomain) into a single loop
  • Collect all domains into a slice first, then iterate once with shared registration logic
  • Removes ~30 lines of duplicated group/non-group registration code
  • Fixes minor inconsistency where custom domain block used routeConfig.Domain but subdomain block used tmpRouteConfig.Domain in CanonicalAddr

Test plan

  • go build ./server/... passes
  • go vet ./server/proxy/... passes
  • Codex deep review confirmed: no issues found, behavior-preserving refactor

🔄 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/fatedier/frp/pull/5207 **Author:** [@fatedier](https://github.com/fatedier) **Created:** 3/6/2026 **Status:** ✅ Merged **Merged:** 3/6/2026 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `new` --- ### 📝 Commits (1) - [`fda83a8`](https://github.com/fatedier/frp/commit/fda83a89ca464657fb64e2534f1dbb75d4129bfd) server/proxy: simplify HTTP proxy domain registration by removing duplicate loop ### 📊 Changes **1 file changed** (+10 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `server/proxy/http.go` (+10 -40) </details> ### 📄 Description ## Summary - Consolidate two nearly identical loop blocks in `HTTPProxy.Run()` (custom domains + subdomain) into a single loop - Collect all domains into a slice first, then iterate once with shared registration logic - Removes ~30 lines of duplicated group/non-group registration code - Fixes minor inconsistency where custom domain block used `routeConfig.Domain` but subdomain block used `tmpRouteConfig.Domain` in `CanonicalAddr` ## Test plan - [x] `go build ./server/...` passes - [x] `go vet ./server/proxy/...` passes - [x] Codex deep review confirmed: no issues found, behavior-preserving refactor --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:56:04 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#5173
No description provided.