瀏覽代碼

check_http.c - Add */* MIME support

Some servers do not work at all or may respond incorrectly without MIME support. This patch adds an Accept: */* for accepting all MIME types. In the future an argument may be provided to alter requested MIME types and check against the response given, this is not currently implemented.
Thanks Alex Gottschalk, patch submitted without pull request.
Spenser Reinhardt 12 年之前
父節點
當前提交
62f32ba7f3
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      plugins/check_http.c

+ 6 - 0
plugins/check_http.c

@@ -912,6 +912,12 @@ check_http (void)
       xasprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, server_port);
   }
 
+  /* Inform server we accept any MIME type response
+   * TODO: Take an arguement to determine what type(s) to accept,
+   * so that we can alert if a response is of an invalid type.
+  */
+  xasprintf(&buf, "%sAccept: */*\r\n", buf);
+
   /* optionally send any other header tag */
   if (http_opt_headers_count) {
     for (i = 0; i < http_opt_headers_count ; i++) {