[PR #3582] [CLOSED] Remove redundant size hint for request info map #4785

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

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/3582
Author: @kallydev
Created: 8/23/2023
Status: Closed

Base: devHead: remove-size-hint-for-map


📝 Commits (1)

  • c6f022b Remove redundant size hint for request info map

📊 Changes

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

View changed files

📝 pkg/util/tcpmux/httpconnect.go (+1 -1)
📝 pkg/util/vhost/https.go (+1 -1)

📄 Description

Summary

🤖 Generated by Copilot at c6f022b

Refactor and simplify code related to HTTP CONNECT protocol. Move GetHTTPSHostname function from pkg/util/vhost/https.go to pkg/util/tcpmux/httpconnect.go and omit zero size argument for reqInfoMap variable.

WHY

golangci-lint updated gosec rules in v1.54.2. https://github.com/golangci/golangci-lint/pull/4015

➜  frp git:(dev) golangci-lint run                        
pkg/util/vhost/https.go:47:2: G602: Potentially accessing slice out of bounds (gosec)
        reqInfoMap["Host"] = clientHello.ServerName
        ^
pkg/util/vhost/https.go:48:2: G602: Potentially accessing slice out of bounds (gosec)
        reqInfoMap["Scheme"] = "https"
        ^
pkg/util/tcpmux/httpconnect.go:104:2: G602: Potentially accessing slice out of bounds (gosec)
        reqInfoMap["Host"] = host
        ^
pkg/util/tcpmux/httpconnect.go:105:2: G602: Potentially accessing slice out of bounds (gosec)
        reqInfoMap["Scheme"] = "tcp"
        ^
pkg/util/tcpmux/httpconnect.go:106:2: G602: Potentially accessing slice out of bounds (gosec)
        reqInfoMap["HTTPUser"] = httpUser
        ^
pkg/util/tcpmux/httpconnect.go:107:2: G602: Potentially accessing slice out of bounds (gosec)
        reqInfoMap["HTTPPwd"] = httpPwd
        ^

🔄 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/3582 **Author:** [@kallydev](https://github.com/kallydev) **Created:** 8/23/2023 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `remove-size-hint-for-map` --- ### 📝 Commits (1) - [`c6f022b`](https://github.com/fatedier/frp/commit/c6f022b293634114be63be1045688cff88debed1) Remove redundant size hint for request info map ### 📊 Changes **2 files changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `pkg/util/tcpmux/httpconnect.go` (+1 -1) 📝 `pkg/util/vhost/https.go` (+1 -1) </details> ### 📄 Description ### Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at c6f022b</samp> Refactor and simplify code related to HTTP CONNECT protocol. Move `GetHTTPSHostname` function from `pkg/util/vhost/https.go` to `pkg/util/tcpmux/httpconnect.go` and omit zero size argument for `reqInfoMap` variable. ### WHY <!-- author to complete --> golangci-lint updated `gosec` rules in `v1.54.2`. https://github.com/golangci/golangci-lint/pull/4015 ``` ➜ frp git:(dev) golangci-lint run pkg/util/vhost/https.go:47:2: G602: Potentially accessing slice out of bounds (gosec) reqInfoMap["Host"] = clientHello.ServerName ^ pkg/util/vhost/https.go:48:2: G602: Potentially accessing slice out of bounds (gosec) reqInfoMap["Scheme"] = "https" ^ pkg/util/tcpmux/httpconnect.go:104:2: G602: Potentially accessing slice out of bounds (gosec) reqInfoMap["Host"] = host ^ pkg/util/tcpmux/httpconnect.go:105:2: G602: Potentially accessing slice out of bounds (gosec) reqInfoMap["Scheme"] = "tcp" ^ pkg/util/tcpmux/httpconnect.go:106:2: G602: Potentially accessing slice out of bounds (gosec) reqInfoMap["HTTPUser"] = httpUser ^ pkg/util/tcpmux/httpconnect.go:107:2: G602: Potentially accessing slice out of bounds (gosec) reqInfoMap["HTTPPwd"] = httpPwd ^ ``` --- <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:48:42 -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#4785
No description provided.