From 10f6fc5141a15e368dac813a38942cb66d5ddef4 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 22 Dec 2024 12:18:33 -0800 Subject: HTTP handler: limit host names to 256 bytes (RFC 1035 specifies 253.) This also makes `nng_http_handler_set_host` never fail (API break). --- docs/man/nng_http_handler_set_host.3http.adoc | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'docs/man') diff --git a/docs/man/nng_http_handler_set_host.3http.adoc b/docs/man/nng_http_handler_set_host.3http.adoc index 0deae488..3f25172f 100644 --- a/docs/man/nng_http_handler_set_host.3http.adoc +++ b/docs/man/nng_http_handler_set_host.3http.adoc @@ -1,6 +1,6 @@ = nng_http_handler_set_host(3http) // -// Copyright 2018 Staysail Systems, Inc. +// Copyright 2024 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This document is supplied under the terms of the MIT License, a @@ -20,7 +20,7 @@ nng_http_handler_set_host - set host for HTTP handler #include #include -int nng_http_handler_set_host(nng_http_handler *handler, const char *host); +void nng_http_handler_set_host(nng_http_handler *handler, const char *host); ---- == DESCRIPTION @@ -41,15 +41,8 @@ ports, the port number can be elided. The matching test only considers the hostname or IP address, and ignores any trailing port number. -== RETURN VALUES - -This function returns 0 on success, and non-zero otherwise. - -== ERRORS - -[horizontal] -`NNG_ENOMEM`:: Insufficient free memory to perform the operation. -`NNG_ENOTSUP`:: No support for HTTP in the library. +NOTE: This should not be used with an IP address normally, as `Host:` header +is used with virtual hosts in HTTP/1.1, and not supported for HTTP/1.0. == SEE ALSO -- cgit v1.2.3-70-g09d2