[PR #6672] [MERGED] [client] fix MDM managementURL conflict on default-port URL echo #29791

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6672
Author: @riccardomanfrin
Created: 7/6/2026
Status: Merged
Merged: 7/6/2026
Merged by: @riccardomanfrin

Base: mainHead: mdm_management_url_normalized


📝 Commits (2)

  • bc33472 Adds failing test
  • 018bab1 Fixes Management URL normalized compare on MDM

📊 Changes

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

View changed files

📝 client/server/mdm.go (+34 -2)
📝 client/server/setconfig_mdm_test.go (+37 -0)

📄 Description

Describe your changes

Fix MDM managementURL conflict false-positive on every settings save
from an MDM-enrolled host. profilemanager.parseURL auto-appends :443
(or :80) to the on-disk config URL, so any later SetConfig / Login report a divergent value.

Reported by @KiskaLE on Intune-managed Windows 11 in
https://github.com/netbirdio/netbird/discussions/6483.

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Internal MDM conflict-check normalization. No change to the public CLI,
API, MDM key surface, or documented URL syntax.

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

N/A

Summary by CodeRabbit

  • Bug Fixes
    • Managed MDM URL settings now normalize default ports, preventing false conflict errors when values differ only by implicit vs explicit ports (for example, https://example vs https://example:443).
    • Configuration saving is more reliable when an enforced URL and the displayed URL vary only by default-port formatting.

🔄 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/6672 **Author:** [@riccardomanfrin](https://github.com/riccardomanfrin) **Created:** 7/6/2026 **Status:** ✅ Merged **Merged:** 7/6/2026 **Merged by:** [@riccardomanfrin](https://github.com/riccardomanfrin) **Base:** `main` ← **Head:** `mdm_management_url_normalized` --- ### 📝 Commits (2) - [`bc33472`](https://github.com/netbirdio/netbird/commit/bc33472ef8885865404127f567d59ffce4146094) Adds failing test - [`018bab1`](https://github.com/netbirdio/netbird/commit/018bab1f4636ffd60a1a00376156bca429627c41) Fixes Management URL normalized compare on MDM ### 📊 Changes **2 files changed** (+71 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `client/server/mdm.go` (+34 -2) 📝 `client/server/setconfig_mdm_test.go` (+37 -0) </details> ### 📄 Description ## Describe your changes Fix MDM `managementURL` conflict false-positive on every settings save from an MDM-enrolled host. `profilemanager.parseURL` auto-appends `:443` (or `:80`) to the on-disk config URL, so any later SetConfig / Login report a divergent value. ## Issue ticket number and link Reported by @KiskaLE on Intune-managed Windows 11 in https://github.com/netbirdio/netbird/discussions/6483. ## Stack <!-- branch-stack --> ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [x] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) Internal MDM conflict-check normalization. No change to the public CLI, API, MDM key surface, or documented URL syntax. ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: N/A <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Managed MDM URL settings now normalize default ports, preventing false conflict errors when values differ only by implicit vs explicit ports (for example, `https://example` vs `https://example:443`). * Configuration saving is more reliable when an enforced URL and the displayed URL vary only by default-port formatting. <!-- 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:08:58 -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#29791