[PR #5655] [CLOSED] Omit proxy_protocol from API response when false #28287

Closed
opened 2026-08-05 08:06:06 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5655
Author: @lixmal
Created: 3/23/2026
Status: Closed

Base: mainHead: fix/proxy-protocol-omitempty


📝 Commits (1)

  • 4be6efa Omit proxy_protocol from API response when false

📊 Changes

1 file changed (+3 additions, -1 deletions)

View changed files

📝 management/internals/modules/reverseproxy/service/service.go (+3 -1)

📄 Description

Summary

  • Only set opts.ProxyProtocol in the API response when the value is true
  • The internal Target model uses a plain bool, which was always being assigned to the *bool API field, causing "proxy_protocol": false to appear in every response even when not configured
  • This caused Terraform ImportStateVerify mismatches in the provider

Test plan

  • Verify existing reverse proxy service tests pass
  • Create a service without proxy_protocol, confirm the field is absent from the GET response
  • Create a service with proxy_protocol=true, confirm it appears in the response

Summary by CodeRabbit

  • Bug Fixes
    • Fixed API response to exclude ProxyProtocol when not applicable, reducing unnecessary response data.

🔄 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/netbirdio/netbird/pull/5655 **Author:** [@lixmal](https://github.com/lixmal) **Created:** 3/23/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/proxy-protocol-omitempty` --- ### 📝 Commits (1) - [`4be6efa`](https://github.com/netbirdio/netbird/commit/4be6efac7317dd294d755a1240a45e17162cb627) Omit proxy_protocol from API response when false ### 📊 Changes **1 file changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `management/internals/modules/reverseproxy/service/service.go` (+3 -1) </details> ### 📄 Description ## Summary - Only set `opts.ProxyProtocol` in the API response when the value is `true` - The internal `Target` model uses a plain `bool`, which was always being assigned to the `*bool` API field, causing `"proxy_protocol": false` to appear in every response even when not configured - This caused Terraform ImportStateVerify mismatches in the provider ## Test plan - Verify existing reverse proxy service tests pass - Create a service without proxy_protocol, confirm the field is absent from the GET response - Create a service with proxy_protocol=true, confirm it appears in the response <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed API response to exclude ProxyProtocol when not applicable, reducing unnecessary response data. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 08:06:06 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#28287