Fix test failure
Now http_parser_parse_url returns nonzero if empty URI is given.
This commit is contained in:
parent
ff87a54202
commit
ab2aa5672b
|
@ -1581,6 +1581,10 @@ int construct_push_component(BlockAllocator &balloc, StringRef &scheme,
|
|||
int rv;
|
||||
StringRef rel, relq;
|
||||
|
||||
if (uri.size() == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
http_parser_url u{};
|
||||
|
||||
rv = http_parser_parse_url(uri.c_str(), uri.size(), 0, &u);
|
||||
|
|
|
@ -995,12 +995,8 @@ void test_http2_construct_push_component(void) {
|
|||
|
||||
uri = StringRef{};
|
||||
|
||||
CU_ASSERT(0 == http2::construct_push_component(balloc, scheme, authority,
|
||||
path, base, uri));
|
||||
CU_ASSERT("" == scheme);
|
||||
CU_ASSERT("" == authority);
|
||||
CU_ASSERT("/" == path);
|
||||
|
||||
CU_ASSERT(-1 == http2::construct_push_component(balloc, scheme, authority,
|
||||
path, base, uri));
|
||||
scheme = StringRef{};
|
||||
authority = StringRef{};
|
||||
path = StringRef{};
|
||||
|
|
Loading…
Reference in New Issue