mirror of
https://gitlab.com/gnuwget/wget2.git
synced 2026-01-14 02:01:39 +00:00
* libwget/http2.c (on_frame_recv_callback): Skip 1xx responses. * tests/Makefile.am: Add test-1xx. * tests/libtest.c (h2_on_frame_recv_callback): Send 1xx response if requested from test. * tests/libtest.h (struct url): Add new member code_1xx. * tests/test-1xx.c: New test file.
36 lines
721 B
C
36 lines
721 B
C
#include <config.h>
|
|
#include <stdlib.h> // exit()
|
|
#include "libtest.h"
|
|
|
|
int main(void)
|
|
{
|
|
wget_test_url_t urls[] = {
|
|
{
|
|
.name = "/index.html",
|
|
.code = "200 OK",
|
|
.code_1xx = "103",
|
|
.body = "<html><body>Hello World</body></html>",
|
|
.headers = {
|
|
"Content-Type: text/html",
|
|
}
|
|
}
|
|
};
|
|
|
|
// functions won't come back if an error occurs
|
|
wget_test_start_server(
|
|
WGET_TEST_RESPONSE_URLS, &urls, countof(urls),
|
|
WGET_TEST_H2_ONLY,
|
|
0);
|
|
|
|
wget_test(
|
|
WGET_TEST_OPTIONS, "--no-check-certificate",
|
|
WGET_TEST_REQUEST_URL, "index.html",
|
|
WGET_TEST_EXPECTED_ERROR_CODE, 0,
|
|
WGET_TEST_EXPECTED_FILES, &(wget_test_file_t []) {
|
|
{ "index.html", urls[0].body },
|
|
{ NULL } },
|
|
0);
|
|
|
|
exit(EXIT_SUCCESS);
|
|
}
|