[PR #1447] [MERGED] Investigate nginx-ui issue 1446 #4376

Closed
opened 2026-02-28 12:00:10 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/0xJacky/nginx-ui/pull/1447
Author: @0xJacky
Created: 11/25/2025
Status: Merged
Merged: 11/25/2025
Merged by: @0xJacky

Base: devHead: cursor/investigate-nginx-ui-issue-1446-gpt-5.1-codex-high-2be0


📝 Commits (1)

  • 54d2764 Refactor: Avoid network requests when health check is disabled

📊 Changes

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

View changed files

📝 internal/sitecheck/checker.go (+26 -11)
internal/sitecheck/checker_test.go (+48 -0)

📄 Description

Prevent disabled site health checks from making network requests to fix issue #1446.

Even when health checks were disabled, the tryGetFavicon function would implicitly trigger HTTP GET requests, leading to unexpected traffic. This PR ensures that when health checks are disabled, cached site metadata is returned immediately without any network activity.


Open in Cursor Open in Web


Note

When health checks are disabled, return cached site metadata without making HTTP requests, leveraging a snapshot of prior site info and adding a unit test to enforce this.

  • Backend (sitecheck):
    • Behavior change: CheckSite now returns cached metadata when HealthCheckEnabled is false, avoiding favicon fetches and all network calls; populates fields from an existing site snapshot if available.
    • Utility: Adds getExistingSiteSnapshot with read-locking to safely clone prior SiteInfo.
  • Tests:
    • Adds TestCheckSiteSkipsNetworkWhenDisabled to ensure no HTTP requests occur when health checks are disabled.

Written by Cursor Bugbot for commit 54d276447e. This will update automatically on new commits. Configure here.


🔄 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/0xJacky/nginx-ui/pull/1447 **Author:** [@0xJacky](https://github.com/0xJacky) **Created:** 11/25/2025 **Status:** ✅ Merged **Merged:** 11/25/2025 **Merged by:** [@0xJacky](https://github.com/0xJacky) **Base:** `dev` ← **Head:** `cursor/investigate-nginx-ui-issue-1446-gpt-5.1-codex-high-2be0` --- ### 📝 Commits (1) - [`54d2764`](https://github.com/0xJacky/nginx-ui/commit/54d276447ed24ebebfd1425cf21ce653a49ecb9f) Refactor: Avoid network requests when health check is disabled ### 📊 Changes **2 files changed** (+74 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `internal/sitecheck/checker.go` (+26 -11) ➕ `internal/sitecheck/checker_test.go` (+48 -0) </details> ### 📄 Description Prevent disabled site health checks from making network requests to fix issue #1446. Even when health checks were disabled, the `tryGetFavicon` function would implicitly trigger HTTP GET requests, leading to unexpected traffic. This PR ensures that when health checks are disabled, cached site metadata is returned immediately without any network activity. --- <a href="https://cursor.com/background-agent?bcId=bc-577bb3c0-699c-4e68-b2ab-9685bf68e0b7"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-577bb3c0-699c-4e68-b2ab-9685bf68e0b7"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web" src="https://cursor.com/open-in-web.svg"></picture></a> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > When health checks are disabled, return cached site metadata without making HTTP requests, leveraging a snapshot of prior site info and adding a unit test to enforce this. > > - **Backend (sitecheck)**: > - **Behavior change**: `CheckSite` now returns cached metadata when `HealthCheckEnabled` is false, avoiding favicon fetches and all network calls; populates fields from an existing site snapshot if available. > - **Utility**: Adds `getExistingSiteSnapshot` with read-locking to safely clone prior `SiteInfo`. > - **Tests**: > - Adds `TestCheckSiteSkipsNetworkWhenDisabled` to ensure no HTTP requests occur when health checks are disabled. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 54d276447ed24ebebfd1425cf21ce653a49ecb9f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 12:00:10 +03: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
starred/nginx-ui#4376
No description provided.