[PR #3763] [MERGED] Only send headers if they are not empty #5523

Closed
opened 2026-10-31 20:47:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/3763
Author: @nebulosa2007
Created: 2/7/2026
Status: ✅ Merged
Merged: 2/7/2026
Merged by: @MHSanaei

Base: main ← Head: sendfilledheadersonly


📝 Commits (1)

  • ad1db42 refactor: set header only if it not empty

📊 Changes

1 file changed (+19 additions, -5 deletions)

View changed files

📝 sub/subController.go (+19 -5)

📄 Description

What is the pull request?

Refactoring/fix: if the value is empty (not set), the panel will not send this header.

Before:

curl -I ...
...
< profile-web-page-url:                                            // from panel (empty string in settings)
< profile-web-page-url: https://mysite.com/sub/jnfkjnfeknferjfnrkj // from nginx

As a result - no info about profile web page in client (Happ)

After:

curl -I ...
...
< profile-web-page-url: https://mysite.com/sub/jnfkjnfeknferjfnrkj // from nginx

Now client gets correctly info about profile page.

In case you want to set headers using add_header ... only in nginx.conf. And, of course, for a clear HTTP response.

Which part of the application is affected by the change?

  • Frontend
  • Backend

Type of Changes

  • Bug fix
  • New feature
  • Refactoring
  • Other

🔄 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/MHSanaei/3x-ui/pull/3763 **Author:** [@nebulosa2007](https://github.com/nebulosa2007) **Created:** 2/7/2026 **Status:** ✅ Merged **Merged:** 2/7/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `sendfilledheadersonly` --- ### 📝 Commits (1) - [`ad1db42`](https://github.com/MHSanaei/3x-ui/commit/ad1db42bf881657c8a17896083c79c4bf7e44fe9) refactor: set header only if it not empty ### 📊 Changes **1 file changed** (+19 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `sub/subController.go` (+19 -5) </details> ### 📄 Description ## What is the pull request? Refactoring/fix: if the value is empty (not set), the panel will not send this header. Before: ``` curl -I ... ... < profile-web-page-url: // from panel (empty string in settings) < profile-web-page-url: https://mysite.com/sub/jnfkjnfeknferjfnrkj // from nginx ``` As a result - no info about profile web page in client (Happ) After: ``` curl -I ... ... < profile-web-page-url: https://mysite.com/sub/jnfkjnfeknferjfnrkj // from nginx ``` Now client gets correctly info about profile page. In case you want to set headers using `add_header ...` only in nginx.conf. And, of course, for a clear HTTP response. ## Which part of the application is affected by the change? - [ ] Frontend - [X] Backend ## Type of Changes - [ ] Bug fix - [ ] New feature - [x] Refactoring - [ ] Other --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:47:34 +07: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
MHSanaei/3x-ui#5523
No description provided.