diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-22 12:18:33 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-22 12:18:33 -0800 |
| commit | 10f6fc5141a15e368dac813a38942cb66d5ddef4 (patch) | |
| tree | d6ebd5663b2aeb876840e5e2560cae77264d1abc /src/supplemental/websocket | |
| parent | 497b8e22047fb0efa3397289d23656d6483fdd6d (diff) | |
| download | nng-10f6fc5141a15e368dac813a38942cb66d5ddef4.tar.gz nng-10f6fc5141a15e368dac813a38942cb66d5ddef4.tar.bz2 nng-10f6fc5141a15e368dac813a38942cb66d5ddef4.zip | |
HTTP handler: limit host names to 256 bytes (RFC 1035 specifies 253.)
This also makes `nng_http_handler_set_host` never fail (API break).
Diffstat (limited to 'src/supplemental/websocket')
| -rw-r--r-- | src/supplemental/websocket/websocket.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/supplemental/websocket/websocket.c b/src/supplemental/websocket/websocket.c index 3dfb3e8e..ba304149 100644 --- a/src/supplemental/websocket/websocket.c +++ b/src/supplemental/websocket/websocket.c @@ -2150,8 +2150,9 @@ nni_ws_listener_alloc(nng_stream_listener **wslp, const nng_url *url) return (rv); } - if (((rv = nni_http_handler_set_host(l->handler, host)) != 0) || - ((rv = nni_http_handler_set_data(l->handler, l, 0)) != 0) || + nni_http_handler_set_host(l->handler, host); + + if (((rv = nni_http_handler_set_data(l->handler, l, 0)) != 0) || ((rv = nni_http_server_init(&l->server, url)) != 0)) { ws_listener_free(l); return (rv); |
