Skip to content

responseOverride fails when scheme does not match #9252

Description

@Elegant996

Description:

What issue is being seen? Describe what should be happening instead of
the bug, for example: The expected value isn't returned, etc.

When using a responseOverride that points to an http-only hostname from an https origin, the override does not occur.

http://mypage.example.com/page-not-found -> status code 404 redirect -> errorpage.redirect.local
https://mypage.example.com/page-not-found -> no redirect -> regular 404 page

Repro steps:

Include sample requests, environment, etc. All data and inputs
required to reproduce the bug.

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: error-pages-direct
spec:
  parentRefs:
    - name: default
      sectionName: http
  hostnames:
    - error-pages.redirect.local
  rules:
    - backendRefs:
        - name: error-pages
          port: 8080
          weight: 1
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: BackendTrafficPolicy
metadata:
  name: default
spec:
  targetSelectors:
    - group: gateway.networking.k8s.io
      kind: Gateway
  responseOverride:
    - match:
        statusCodes:
          - type: Value
            value: 404 # Not Found
      redirect:
        hostname: error-pages.redirect.local
        path:
          type: ReplaceFullPath
          replaceFullPath: /404
        statusCode: 302

There are some instances where this "works" with an https listener and a wildcard certificate but we shouldn't need to add a certificate requirement for what should be considered an internal redirect.

Environment:

Include the environment like gateway version, envoy version and so on.

Using gateway 1.8.1 deployed through helm chart.

Logs:

Include the access logs and the Envoy logs.

No logs as no redirect occurs~

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions