Commit c14697b
committed
pandaproxy: register default_404_handler in server::start()
Wires the new handler so Seastar's routes table dispatches to it for
any (method, path) combination that no registered route matches.
Without this, Seastar's built-in routes::handle() short-circuits with
its own JSON body that uses {"code": 404} instead of the
{"error_code": 404} shape SR clients expect, breaking 404-fallback
paths in external SR client serializers.
The handler is owned by pandaproxy::server via unique_ptr because
Seastar's add_default_handler does not take ownership (per
seastar/include/seastar/http/routes.hh:136). Declared before _server
so it is destroyed after, giving the strongest lifetime guarantee for
the routes table's raw pointer to it.
Both REST proxy and schema registry use pandaproxy::server, so this
fixes the body shape for both subsystems with a single registration.1 parent ee07e38 commit c14697b
2 files changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
261 | 266 | | |
262 | 267 | | |
263 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
0 commit comments