Navigation Menu

Skip to content

Commit

Permalink
http: don't accept "Expect: 100-CONTINUE"
Browse files Browse the repository at this point in the history
Because RFC 2616 says the following at "8.2.3 Use of the
100 (Continue) Status":

> - If a client will wait for a 100 (Continue) response before
>   sending the request body, it MUST send an Expect request-header
>   field (section 14.20) with the "100-continue" expectation.
  • Loading branch information
kou committed Jun 7, 2014
1 parent 71fefef commit ed9af1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/groonga.c
Expand Up @@ -763,6 +763,10 @@ typedef struct {
const char *body_start;
} h_post_header;

#define STRING_EQUAL(string, string_length, constant_string)\
(string_length == strlen(constant_string) &&\
strncmp(string, constant_string, string_length) == 0)

#define STRING_EQUAL_CI(string, string_length, constant_string)\
(string_length == strlen(constant_string) &&\
strncasecmp(string, constant_string, string_length) == 0)
Expand Down Expand Up @@ -879,7 +883,7 @@ do_htreq_post_parse_header_values(grn_ctx *ctx,
header->content_length = -1;
}
} else if (STRING_EQUAL_CI(name, name_length, "Expect")) {
if (STRING_EQUAL_CI(value, value_length, "100-continue")) {
if (STRING_EQUAL(value, value_length, "100-continue")) {
header->have_100_continue = GRN_TRUE;
}
}
Expand Down

0 comments on commit ed9af1f

Please sign in to comment.