瀏覽代碼

core: parser - trim trailing whitespaces in header name

(cherry picked from commit 7135feee9cdc93efa8c0c3e4abf24a9335ce42de)
Daniel-Constantin Mierla 5 年之前
父節點
當前提交
63e227383d
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/core/parser/parse_hname2.c

+ 4 - 1
src/core/parser/parse_hname2.c

@@ -27,9 +27,10 @@
  */
 
 #include "../comp_defs.h"
+#include "../trim.h"
+#include "../ut.h"  /* q_memchr */
 #include "parse_hname2.h"
 #include "keys.h"
-#include "../ut.h"  /* q_memchr */
 
 #define LOWER_BYTE(b) ((b) | 0x20)
 #define LOWER_DWORD(d) ((d) | 0x20202020)
@@ -238,6 +239,7 @@ char* parse_hname2(char* const begin, const char* const end, struct hdr_field* c
 	        goto other;
 	} else {
 		hdr->name.len = p - hdr->name.s;
+		trim_trailing(&hdr->name);
 		return (p + 1);
 	}
 
@@ -252,6 +254,7 @@ char* parse_hname2(char* const begin, const char* const end, struct hdr_field* c
 	} else {
 		hdr->type = HDR_OTHER_T;
 		hdr->name.len = p - hdr->name.s;
+		trim_trailing(&hdr->name);
 		/*hdr_update_type(hdr);*/
 		return (p + 1);
 	}