Skip to content

Fix proxy_set_header for websocket and custom override locations - #53

Open
mesudip wants to merge 1 commit into
masterfrom
chore/fix-proxy-set-header-override
Open

Fix proxy_set_header for websocket and custom override locations#53
mesudip wants to merge 1 commit into
masterfrom
chore/fix-proxy-set-header-override

Conversation

@mesudip

@mesudip mesudip commented Jun 16, 2026

Copy link
Copy Markdown
Owner

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a ProxyHeaderProcessor to manage the reinsertion of default proxy headers when custom headers are injected or for websocket locations. It also updates the Jinja2 template to conditionally render these headers and adds comprehensive unit tests. The review feedback highlights a fragile type check in ProxyHeaderProcessor where checking for list instead of str can break other iterable types. Additionally, it suggests simplifying both the Python logic and the Jinja2 template by treating all websocket locations as requiring header reinsertion, which would eliminate redundant hardcoded blocks in the template.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread nginx_proxy/post_processors/proxy_header_processor.py
Comment thread nginx_proxy/post_processors/proxy_header_processor.py
Comment thread vhosts_template/default.conf.jinja2
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.61%. Comparing base (c8c60b0) to head (aff3d9e).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...nx_proxy/post_processors/proxy_header_processor.py 94.28% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
+ Coverage   70.31%   70.61%   +0.29%     
==========================================
  Files          31       32       +1     
  Lines        3261     3301      +40     
  Branches      542      550       +8     
==========================================
+ Hits         2293     2331      +38     
- Misses        801      802       +1     
- Partials      167      168       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant