aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/supplemental/http/http_server.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c
index 2273e3be..fc7a3075 100644
--- a/src/supplemental/http/http_server.c
+++ b/src/supplemental/http/http_server.c
@@ -1571,6 +1571,9 @@ nni_http_handler_init_static(nni_http_handler **hpp, const char *uri,
if ((hs = NNI_ALLOC_STRUCT(hs)) == NULL) {
return (NNG_ENOMEM);
}
+ if (ctype == NULL) {
+ ctype = "application/octet-stream";
+ }
if (((hs->ctype = nni_strdup(ctype)) == NULL) ||
((size > 0) && ((hs->data = nni_alloc(size)) == NULL))) {
http_static_free(hs);