diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-01-10 12:37:13 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-01-10 13:57:42 -0800 |
| commit | 0274024abf87c3bc9fc81bafe5bd2a4391192705 (patch) | |
| tree | 3058820a6d1a775796a82bf4d5951542b78e55e7 /docs/man | |
| parent | 292b98dfea50c898affdeb38be94429d171d2491 (diff) | |
| download | nng-0274024abf87c3bc9fc81bafe5bd2a4391192705.tar.gz nng-0274024abf87c3bc9fc81bafe5bd2a4391192705.tar.bz2 nng-0274024abf87c3bc9fc81bafe5bd2a4391192705.zip | |
http: drop exclusive tree mode
Nothing really needs it -- we kept it in 1.0 to preserve semantics,
but there is no requirement for semantic preservation in 2.0.
Diffstat (limited to 'docs/man')
| -rw-r--r-- | docs/man/nng_http_handler_alloc.3http.adoc | 7 | ||||
| -rw-r--r-- | docs/man/nng_http_handler_set_tree.3http.adoc | 20 |
2 files changed, 5 insertions, 22 deletions
diff --git a/docs/man/nng_http_handler_alloc.3http.adoc b/docs/man/nng_http_handler_alloc.3http.adoc index 8d55c752..3eb9674a 100644 --- a/docs/man/nng_http_handler_alloc.3http.adoc +++ b/docs/man/nng_http_handler_alloc.3http.adoc @@ -114,11 +114,7 @@ The `Content-Type` will be set automatically based upon the extension of the requested file name. If a content type cannot be determined from the extension, then `application/octet-stream` is used. -The directory handler is created as a tree handler initially in exclusive mode (see -xref:nng_http_handler_set_tree.3http.adoc[nng_http_handler_set_tree_exclusive]). -This can be changed by calling -xref:nng_http_handler_set_tree.3http.adoc[nng_http_handler_set_tree(3http)] -after creating the directory handler. +The directory handler is created as a tree handler. === File Handler @@ -183,7 +179,6 @@ xref:nng_http_handler_free.3http.adoc[nng_http_handler_free(3http)], xref:nng_http_handler_set_host.3http.adoc[nng_http_handler_set_host(3http)], xref:nng_http_handler_set_method.3http.adoc[nng_http_handler_set_method(3http)], xref:nng_http_handler_set_tree.3http.adoc[nng_http_handler_set_tree(3http)], -xref:nng_http_handler_set_tree.3http.adoc[nng_http_handler_set_tree_exclusive(3http)], xref:nng_http_server_add_handler.3http.adoc[nng_http_server_add_handler(3http)], xref:nng_strerror.3.adoc[nng_strerror(3)], xref:nng_aio.5.adoc[nng_aio(5)], diff --git a/docs/man/nng_http_handler_set_tree.3http.adoc b/docs/man/nng_http_handler_set_tree.3http.adoc index 821a5f7b..77b1cc59 100644 --- a/docs/man/nng_http_handler_set_tree.3http.adoc +++ b/docs/man/nng_http_handler_set_tree.3http.adoc @@ -1,6 +1,6 @@ = nng_http_handler_set_tree(3http) -// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // Copyright 2020 Dirac Research <robert.bielik@dirac.com> // @@ -21,8 +21,6 @@ nng_http_handler_set_tree - set HTTP handler to match trees #include <nng/http.h> void nng_http_handler_set_tree(nng_http_handler *handler); - -void nng_http_handler_set_tree_exclusive(nng_http_handler *handler); ---- == DESCRIPTION @@ -31,27 +29,17 @@ The `nng_http_handler_set_tree()` function causes the _handler_ to be matched if by the client is a logical child of the path for _handler_, and no more specific _handler_ has been registered. -The `nng_http_handler_set_tree_exclusive()` function is similar to `nng_http_server_set_tree()` -with the distinction that the _handler_ will be considered to *exclusively* handle its request URI. -Unlike `nng_http_server_set_tree()`, it will not be possible to register additional -handlers in logical subdirectories of _handler_. - This is useful in cases when the handler would like to examine the entire path and possibly behave differently; for example a REST API that uses the rest of the path to pass additional parameters. -TIP: These methods are useful when constructing API handlers where a single +TIP: This function is useful when constructing API handlers where a single service address (path) supports dynamically generated children. - -TIP: The non-exclusive form is also useful for providing a default handler to be -generated when a more specific child does not exist. -This can provide a better experience for users than the standard 404 error -handling. +It can also provide a logical fallback instead of relying on a 404 error code. == SEE ALSO [.text-left] xref:nng_http_handler_alloc.3http.adoc[nng_http_handler_alloc(3http)], xref:nng_http_server_add_handler.3http.adoc[nng_http_server_add_handler(3http)], -xref:nng_http_get_method.3http.adoc[nng_http_get_method(3http)], -xref:nng.7.adoc[nng(7)] +xref:nng_http_get_method.3http.adoc[nng_http_get_method(3http)] |
