Browse code

core: parser - trim trailing whitespaces in header name

(cherry picked from commit 7135feee9cdc93efa8c0c3e4abf24a9335ce42de)

Daniel-Constantin Mierla authored on 16/07/2020 07:09:48
Showing 1 changed files
... ...
@@ -27,9 +27,10 @@
27 27
  */
28 28
 
29 29
 #include "../comp_defs.h"
30
+#include "../trim.h"
31
+#include "../ut.h"  /* q_memchr */
30 32
 #include "parse_hname2.h"
31 33
 #include "keys.h"
32
-#include "../ut.h"  /* q_memchr */
33 34
 
34 35
 #define LOWER_BYTE(b) ((b) | 0x20)
35 36
 #define LOWER_DWORD(d) ((d) | 0x20202020)
... ...
@@ -238,6 +239,7 @@ char* parse_hname2(char* const begin, const char* const end, struct hdr_field* c
238 239
 	        goto other;
239 240
 	} else {
240 241
 		hdr->name.len = p - hdr->name.s;
242
+		trim_trailing(&hdr->name);
241 243
 		return (p + 1);
242 244
 	}
243 245
 
... ...
@@ -252,6 +254,7 @@ char* parse_hname2(char* const begin, const char* const end, struct hdr_field* c
252 254
 	} else {
253 255
 		hdr->type = HDR_OTHER_T;
254 256
 		hdr->name.len = p - hdr->name.s;
257
+		trim_trailing(&hdr->name);
255 258
 		/*hdr_update_type(hdr);*/
256 259
 		return (p + 1);
257 260
 	}