@@ -170,7 +170,7 @@ struct MIMEField {
170170 int value_get_comma_list (StrList *list) const ;
171171
172172 void name_set (HdrHeap *heap, MIMEHdrImpl *mh, const char *name, int length);
173- bool name_is_valid () const ;
173+ bool name_is_valid (uint32_t invalid_char_bits = is_control_BIT ) const ;
174174
175175 void value_set (HdrHeap *heap, MIMEHdrImpl *mh, const char *value, int length);
176176 void value_set_int (HdrHeap *heap, MIMEHdrImpl *mh, int32_t value);
@@ -182,7 +182,7 @@ struct MIMEField {
182182 // Other separators (e.g. ';' in Set-cookie/Cookie) are also possible
183183 void value_append (HdrHeap *heap, MIMEHdrImpl *mh, const char *value, int length, bool prepend_comma = false ,
184184 const char separator = ' ,' );
185- bool value_is_valid () const ;
185+ bool value_is_valid (uint32_t invalid_char_bits = is_control_BIT ) const ;
186186 int has_dups () const ;
187187};
188188
@@ -972,13 +972,13 @@ MIMEField::name_set(HdrHeap *heap, MIMEHdrImpl *mh, const char *name, int length
972972 -------------------------------------------------------------------------*/
973973
974974inline bool
975- MIMEField::name_is_valid () const
975+ MIMEField::name_is_valid (uint32_t invalid_char_bits ) const
976976{
977977 const char *name;
978978 int length;
979979
980980 for (name = name_get (&length); length > 0 ; length--) {
981- if (ParseRules::is_control (name[length - 1 ])) {
981+ if (ParseRules::is_type (name[length - 1 ], invalid_char_bits )) {
982982 return false ;
983983 }
984984 }
@@ -1081,13 +1081,13 @@ MIMEField::value_append(HdrHeap *heap, MIMEHdrImpl *mh, const char *value, int l
10811081 -------------------------------------------------------------------------*/
10821082
10831083inline bool
1084- MIMEField::value_is_valid () const
1084+ MIMEField::value_is_valid (uint32_t invalid_char_bits ) const
10851085{
10861086 const char *value;
10871087 int length;
10881088
10891089 for (value = value_get (&length); length > 0 ; length--) {
1090- if (ParseRules::is_control (value[length - 1 ])) {
1090+ if (ParseRules::is_type (value[length - 1 ], invalid_char_bits )) {
10911091 return false ;
10921092 }
10931093 }
0 commit comments