Some OpenAPI calls inherit invalid Host header when needing to `getChangeFeed()`.
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 56
- Forks
- 63
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 34
Description
What did you do?
-
Start a cluster
tiup playground-ng v8.5.8 --db 1 --kv 1 --pd 1 --ticdc 1 --tiflash 0 --without-monitor --ticdc.config ./ticdc-newarch.toml -
Create an empty changefeed
tiup cdc:v8.5.8 cli changefeed create -c test --sink-uri 'blackhole://' -
List the changefeeds using OpenAPI v2 with an invalid Host header
curl -H 'Host: example.invalid' http://127.0.0.1:8300/api/v2/changefeeds -
List tables in the
testchangefeed using OpenAPI v2 with an invalid Host headercurl -H 'Host: example.invalid' http://127.0.0.1:8300/api/v2/changefeeds/test/tables
What did you expect to see?
Either both 3 and 4 are invalid, or both 3 and 4 work fine.
What did you see instead?
Step 3 returned valid result, while step 4 returned HTTP 500.
{
"error_msg": "Get \"http://example.invalid/api/v2/changefeeds/test?keyspace=default\": dial tcp: lookup example.invalid: no such host",
"error_code": ""
}
Versions of the cluster
v8.5.8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the discrepancy with the TiUP cluster and the two curl commands in the issue. Then trace the OpenAPI v2 handlers for /api/v2/changefeeds and /api/v2/changefeeds/{id}/tables, focusing on getChangeFeed and Host handling; done means both requests behave consistently with an invalid Host header and the regression is covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100