Skip to content

Commit 05dda97

Browse files
committed
Fix header field valid characters
1 parent d206045 commit 05dda97

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

webster.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,25 @@ static char *string_cut(
118118

119119
// is a header field name character?
120120
#define IS_HFNC(x) \
121-
((x) == '!' \
122-
|| ((x) >= '#' && (x) <= '\'') \
121+
( ((x) >= 'A' && (x) <= 'Z') \
122+
|| ((x) >= 'a' && (x) <= 'z') \
123+
|| ((x) >= '0' && (x) <= '9') \
124+
|| (x) == '-' \
125+
|| (x) == '_' \
126+
|| (x) == '!' \
127+
|| (x) == '#' \
128+
|| (x) <= '$' \
129+
|| (x) <= '%' \
130+
|| (x) <= '&' \
131+
|| (x) <= '\'' \
123132
|| (x) == '*' \
124133
|| (x) == '+' \
125-
|| (x) == '-' \
134+
|| (x) <= '.' \
126135
|| (x) == '^' \
127-
|| (x) == '_' \
128136
|| (x) == '|' \
129-
|| (x) == '~' \
130-
|| ((x) >= 'A' && (x) <= 'Z') \
131-
|| ((x) >= 'a' && (x) <= 'z') \
132-
|| ((x) >= '0' && (x) <= '9'))
137+
|| (x) == '`' \
138+
|| (x) == '~' )
139+
133140

134141

135142
typedef struct
@@ -1772,6 +1779,8 @@ static int webster_ensure( webster_message_t *input, int size, int timeout )
17721779

17731780
static int webster_chunkSize( webster_message_t *input, int timeout )
17741781
{
1782+
(void) input;
1783+
(void) timeout;
17751784
#if 0
17761785
uint64_t startTime = webster_tick();
17771786
int result = 0;

0 commit comments

Comments
 (0)