瀏覽代碼

microhttpd: warning on failing to add content-type

(cherry picked from commit 2b331d95ae62eb0000a289e1bdb668ee7bc572cb)
Daniel-Constantin Mierla 5 月之前
父節點
當前提交
039c877b88
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/modules/microhttpd/microhttpd_mod.c

+ 4 - 1
src/modules/microhttpd/microhttpd_mod.c

@@ -373,7 +373,10 @@ static int ksr_mhttpd_send_reply(
 		return -1;
 	}
 	if(sctype->len > 0) {
-		MHD_add_response_header(response, "Content-Type", sctype->s);
+		if(MHD_add_response_header(response, "Content-Type", sctype->s)
+				== MHD_NO) {
+			LM_WARN("failed to add Content-Type header\n");
+		}
 	}
 	ret = MHD_queue_response(
 			_ksr_mhttpd_ctx.connection, (unsigned int)rcode, response);