[PR #3896] [CLOSED] fix: ClientConfig marshals incorrectly #4861

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

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/3896
Author: @free6om
Created: 12/26/2023
Status: Closed

Base: devHead: dev


📝 Commits (1)

  • 4712e3a fix: ClientConfig marshals incorrectly

📊 Changes

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

View changed files

📝 pkg/config/v1/proxy.go (+4 -0)
📝 pkg/config/v1/proxy_test.go (+56 -0)

📄 Description

WHY

the output of yaml.Marshal(&ClientConfig{}) is incorrect, this PR fixed this error.

How to reproduce it

  1. build a ClientConfig object clientConfig with Proxies field set
  2. call yaml.Marshal(&clientConfig) and set the output to yamlConfig
  3. call config.LoadConfigure(yamlConfig, &clientConfig, false) to unmarshal the output
  4. check the new unmarshalled clientConfig, the Proxies part is lost

🔄 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/3896 **Author:** [@free6om](https://github.com/free6om) **Created:** 12/26/2023 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (1) - [`4712e3a`](https://github.com/fatedier/frp/commit/4712e3a63936f95b4d7d3b3aaa2d31730f7be456) fix: ClientConfig marshals incorrectly ### 📊 Changes **2 files changed** (+60 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `pkg/config/v1/proxy.go` (+4 -0) 📝 `pkg/config/v1/proxy_test.go` (+56 -0) </details> ### 📄 Description ### WHY the output of `yaml.Marshal(&ClientConfig{})` is incorrect, this PR fixed this error. ### How to reproduce it 1. build a `ClientConfig` object `clientConfig` with `Proxies` field set 2. call `yaml.Marshal(&clientConfig)` and set the output to `yamlConfig` 3. call `config.LoadConfigure(yamlConfig, &clientConfig, false)` to unmarshal the output 4. check the new unmarshalled `clientConfig`, the `Proxies` part is lost --- <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:50:09 -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#4861
No description provided.