diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-22 12:57:19 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-22 13:03:35 -0800 |
| commit | a24b4f11799806e08638162901039fd23efe48be (patch) | |
| tree | 24f29c8eeb234c1228615478555c3c4d2fcdb761 /docs/man | |
| parent | d60a16af349de45477efc566760130b51ff7cf1e (diff) | |
| download | nng-a24b4f11799806e08638162901039fd23efe48be.tar.gz nng-a24b4f11799806e08638162901039fd23efe48be.tar.bz2 nng-a24b4f11799806e08638162901039fd23efe48be.zip | |
http: limit handler uri to 1K
This is just the part of the tree that will be matched when looking
up a handler. Requests may come in with very much longer URIs, and
be matched to the handler as a "subdirectory".
This approach makes it possible to avoid a dynamic allocation on the
handler, at the cost of pre-allocating 1KB with the handler object.
This size can be overridden using a NNG_HTTP_MAX_URI at compile time.
Diffstat (limited to 'docs/man')
| -rw-r--r-- | docs/man/nng_http_handler_alloc.3http.adoc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/man/nng_http_handler_alloc.3http.adoc b/docs/man/nng_http_handler_alloc.3http.adoc index c7d4699f..7795bbf5 100644 --- a/docs/man/nng_http_handler_alloc.3http.adoc +++ b/docs/man/nng_http_handler_alloc.3http.adoc @@ -51,6 +51,12 @@ by the _path_ argument. Only the path component of the Request URI is considered when determining whether the handler should be called. +This implementation limits the _path_ length to 1024 bytes, including the +zero termination byte. This does not prevent requests with much longer +URIs from being supported, doing so will require setting the handler +to matching a parent path in the tree using +xref:nng_http_handler_set_tree.3http.adoc[`nng_http_handler_set_tree`()]. + Additionally each handler has a method it is registered to handle (the default is `GET`, see xref:nng_http_handler_set_method.3http.adoc[`nng_http_handler_set_method()`]), and |
