Skip to content

Conversation

@mikolajkucinski
Copy link
Contributor

Description

Gardener started enabling Envoy for loadbalancing which routes requests based on the Host header. The CORS proxy uses httputil.NewSingleHostReverseProxy which preserves the original clients Host header instead of rewriting it to the target URL.
Override the default Director function to rewrite the Host header to match the target URL.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Added to documentation?

  • 📜 README.md
  • 🤝 Documentation pages updated
  • 🙅 no documentation needed
  • (if applicable) generated OpenAPI docs for CRD changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Override default Director to set Host header to target URL.
NewSingleHostReverseProxy preserves original Host header which
causes 404 errors with Envoy-based loadbalancers in Gardener.

On-behalf-of: @SAP mikolaj.kucinski@sap.com
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.

🐛 [BUG] - CORS Proxy does not rewrite host header

2 participants