Copilot commented on code in PR #158:
URL:
https://github.com/apache/dubbo-go-pixiu-samples/pull/158#discussion_r3294398220
##########
dubbogo/simple/traffic/pixiu/header-conf.yaml:
##########
@@ -58,8 +58,8 @@ static_resources:
- name: REG
values: ["t{2}"]
regex: true
- route:
- cluster: "user-v3"
+ route:
+ cluster: "user-v3"
Review Comment:
The change here alters YAML indentation for the `route` block; if `route` is
no longer at the same list-item level as the corresponding `match` entry,
Pixiu/Envoy route matching can break or the config can become invalid. Please
verify `route:` is aligned with its owning route entry (typically the same
indentation level as `match:`) and consider adding/using a config validation
step (e.g., CI yamllint + Pixiu config check) to prevent indentation
regressions.
##########
dubbogo/simple/traffic/test/pixiu_test.go:
##########
@@ -85,10 +85,11 @@ func TestHeaderGET1(t *testing.T) {
}
func TestHeaderGET2(t *testing.T) {
- url := "http://localhost:8888"
+ url := "http://localhost:8888/user"
client := &http.Client{Timeout: 5 * time.Second}
req, err := http.NewRequest("GET", url, nil)
assert.NoError(t, err)
+ req.Header.Add("X-B", "t4")
Review Comment:
For tests where you expect a single value per header key, `Header.Set` is
usually safer than `Header.Add` because it avoids accidental duplicated header
values if the header is set elsewhere (e.g., in shared helpers or reused
requests). Consider using `req.Header.Set(\"X-B\", \"t4\")` here unless
multiple `X-B` values are intentional.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]