Skip to content

docs: requestHeaderPolicy example in Request Rewriting documentation #6805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
arosh opened this issue Dec 10, 2024 · 3 comments
Closed

docs: requestHeaderPolicy example in Request Rewriting documentation #6805

arosh opened this issue Dec 10, 2024 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@arosh
Copy link

arosh commented Dec 10, 2024

What steps did you take and what happened:

I found a potentially incorrect YAML example in the documentation at https://projectcontour.io/docs/main/config/request-rewriting/#manipulating-the-host-header

The current example shows requestHeaderPolicy as a separate route element:

apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: static-host-header-rewrite-route
spec:
  fqdn: local.projectcontour.io
  routes:
    - conditions:
      - prefix: /
      services:
        - name: s1
          port: 80
    - requestHeaderPolicy:
        set:
        - name: host
          value: foo.com

What did you expect to happen:

I believe requestHeaderPolicy should be part of the same route element, not a separate one. The correct YAML should be:

apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: static-host-header-rewrite-route
spec:
  fqdn: local.projectcontour.io
  routes:
    - conditions:
      - prefix: /
      services:
        - name: s1
          port: 80
      requestHeaderPolicy:
        set:
        - name: host
          value: foo.com

Here's the diff showing the change:

 routes:
   - conditions:
     - prefix: /
     services:
       - name: s1
         port: 80
-  - requestHeaderPolicy:
+    requestHeaderPolicy:
       set:
       - name: host
         value: foo.com

The current example would likely not work as intended because it shows requestHeaderPolicy as a separate route element without any conditions or services. While this might be valid YAML syntax, it would not achieve the expected header rewriting behavior.

Anything else you would like to add:

Could you please confirm if this is indeed a documentation error? If my understanding is correct, the current example might be misleading for users.

Environment:

N/A (Documentation issue)

@arosh arosh added kind/bug Categorizes issue or PR as related to a bug. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. labels Dec 10, 2024
Copy link

Hey @arosh! Thanks for opening your first issue. We appreciate your contribution and welcome you to our community! We are glad to have you here and to have your input on Contour. You can also join us on our mailing list and in our channel in the Kubernetes Slack Workspace

Copy link

The Contour project currently lacks enough contributors to adequately respond to all Issues.

This bot triages Issues according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, the Issue is closed

You can:

  • Mark this Issue as fresh by commenting
  • Close this Issue
  • Offer to help out with triage

Please send feedback to the #contour channel in the Kubernetes Slack

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 10, 2025
Copy link

The Contour project currently lacks enough contributors to adequately respond to all Issues.

This bot triages Issues according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, the Issue is closed

You can:

  • Mark this Issue as fresh by commenting
  • Close this Issue
  • Offer to help out with triage

Please send feedback to the #contour channel in the Kubernetes Slack

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

1 participant