Skip to content
Snippets Groups Projects
Commit a620e99a authored by Yang Gao's avatar Yang Gao
Browse files

Merge pull request #3111 from ctiller/reject-the-stuffs

Outlaw comma in non-binary metadata values
parents 400e0cdd e535aacf
No related branches found
No related tags found
No related merge requests found
...@@ -703,7 +703,7 @@ int grpc_mdstr_is_legal_header(grpc_mdstr *s) { ...@@ -703,7 +703,7 @@ int grpc_mdstr_is_legal_header(grpc_mdstr *s) {
int grpc_mdstr_is_legal_nonbin_header(grpc_mdstr *s) { int grpc_mdstr_is_legal_nonbin_header(grpc_mdstr *s) {
static const gpr_uint8 legal_header_bits[256 / 8] = { static const gpr_uint8 legal_header_bits[256 / 8] = {
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
return conforms_to(s, legal_header_bits); return conforms_to(s, legal_header_bits);
......
...@@ -66,7 +66,10 @@ int main(void) { ...@@ -66,7 +66,10 @@ int main(void) {
dump(); dump();
clear(); clear();
for (i = 32; i <= 126; i++) legal(i); for (i = 32; i <= 126; i++) {
if (i == ',') continue;
legal(i);
}
dump(); dump();
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment