info: do not include INFO_HTTP_VERSION in httpStatusToReply return
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 14 Apr 2016 23:17:39 +0000 (01:17 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 15 Apr 2016 09:59:49 +0000 (11:59 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/info/http_headers.c
lib/info/http_headers.h

index 1098e69..c376a7e 100644 (file)
@@ -53,7 +53,7 @@ void http_header_build(const char *plugin_name, unsigned int status, const char
   assert(contentLengthIndex);
 
   /* Status */
-  abuf_appendf(abuf, "%s\r\n", httpStatusToReply(status));
+  abuf_appendf(abuf, "%s %s\r\n", INFO_HTTP_VERSION, httpStatusToReply(status));
 
   /* Date */
   {
index 091b9be..4d2b901 100644 (file)
@@ -62,14 +62,14 @@ void http_header_adjust_content_length(struct autobuf *abuf, int contentLengthIn
 static INLINE const char * httpStatusToReply(unsigned int status) {
   switch (status) {
     case INFO_HTTP_NOCONTENT:
-      return INFO_HTTP_VERSION " 204 No Content";
+      return "204 No Content";
 
     case INFO_HTTP_NOTFOUND:
-      return INFO_HTTP_VERSION " 404 Not Found";
+      return "404 Not Found";
 
     case INFO_HTTP_OK:
     default:
-      return INFO_HTTP_VERSION " 200 OK";
+      return "200 OK";
   }
 }