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/http/http_public.c | |
| 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/http/http_public.c')
| -rw-r--r-- | src/supplemental/http/http_public.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/supplemental/http/http_public.c b/src/supplemental/http/http_public.c index e3093d45..a60743fd 100644 --- a/src/supplemental/http/http_public.c +++ b/src/supplemental/http/http_public.c @@ -609,15 +609,14 @@ nng_http_handler_collect_body(nng_http_handler *h, bool want, size_t len) #endif } -int +void nng_http_handler_set_host(nng_http_handler *h, const char *host) { #ifdef NNG_SUPP_HTTP - return (nni_http_handler_set_host(h, host)); + nni_http_handler_set_host(h, host); #else NNI_ARG_UNUSED(h); NNI_ARG_UNUSED(host); - return (NNG_ENOTSUP); #endif } |
