envoyproxy / envoyproxy/gateway

Supression of X-Envoy headers breaks expected output of default log format

Offen
#2,903 5 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
help wanted kind/bug
Vorherrschende Sprache
Go
Sterne
3k
Forks
864
Ø Merge
2 T. 2 Std.
Gemergte PRs (30 T.)
140

Beschreibung

*Description*:

After the changes in #2500 and #2585 logs no longer include the proper request path where path rewrites are used.

*Repro steps*:

If you apply the quickstart demo and then add a rule to the HTTPRoute:

```
- backendRefs:
- group: ""
kind: Service
name: backend
port: 3000
weight: 1
matches:
- path:
type: PathPrefix
value: /rewrite
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /123
```

This request:

```
curl -sv -H "Host: www.example.com" 'http://172.18.255.200/rewrite/something?foo=bar'
```

Would normally (and previously did) result in the following log output):

```
{
"start_time": "2024-03-13T02:18:21.648Z",
"method": "GET",
"x-envoy-origin-path": "/rewrite/something?foo=bar",
"protocol": "HTTP/1.1",
"response_code": "200",
...
"duration": "1",
"x-envoy-upstream-service-time": "0",
...
}
```

It is now incorrectly outputting the rewritten path instead and losing the original request path:

```
{
"start_time": "2024-03-13T02:23:29.892Z",
"method": "GET",
"x-envoy-origin-path": "/123/something?foo=bar",
"protocol": "HTTP/1.1",
"response_code": "200",
...
"duration": "1",
"x-envoy-upstream-service-time": "-",
...
}
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.