From 617bb5112834eee40d7eaf00bfc7e98e0ae1ff01 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 7 Oct 2018 13:04:00 -0700 Subject: fixes #745 HTTP server redirect handler --- src/supplemental/http/http.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/supplemental/http/http.h') diff --git a/src/supplemental/http/http.h b/src/supplemental/http/http.h index d9edd5c8..d0854981 100644 --- a/src/supplemental/http/http.h +++ b/src/supplemental/http/http.h @@ -328,6 +328,12 @@ NNG_DECL int nng_http_handler_alloc_file( NNG_DECL int nng_http_handler_alloc_static( nng_http_handler **, const char *, const void *, size_t, const char *); +// nng_http_handler_alloc_redirect creates an HTTP redirect handler. +// The status is given, along with the new URL. If the status is 0, +// then 301 will be used instead. +NNG_DECL int nng_http_handler_alloc_redirect( + nng_http_handler **, const char *, uint16_t, const char *); + // nng_http_handler_alloc_file creates a "directory" based handler, that // serves up static content from the given directory tree. Directories // that contain an index.html or index.htm file use that file for the -- cgit v1.2.3-70-g09d2