diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-10-07 13:04:00 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-10-07 13:14:13 -0700 |
| commit | 617bb5112834eee40d7eaf00bfc7e98e0ae1ff01 (patch) | |
| tree | 686a5566b64d1cb79b495e00f5c106145f58b74b /src/supplemental/http/http.h | |
| parent | 6c334f30cccaa9ddae81ee0865621b6695fb7e3a (diff) | |
| download | nng-617bb5112834eee40d7eaf00bfc7e98e0ae1ff01.tar.gz nng-617bb5112834eee40d7eaf00bfc7e98e0ae1ff01.tar.bz2 nng-617bb5112834eee40d7eaf00bfc7e98e0ae1ff01.zip | |
fixes #745 HTTP server redirect handler
Diffstat (limited to 'src/supplemental/http/http.h')
| -rw-r--r-- | src/supplemental/http/http.h | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
