diff --git a/configure.ac b/configure.ac index f15a535..5470863 100644 --- a/configure.ac +++ b/configure.ac @@ -81,7 +81,7 @@ AS_IF([test "${with_ssl} ${with_http2}" == "check check"], [ AC_CHECK_LIB([nghttp2], [nghttp2_session_client_new], [ LIBS="-lnghttp2 $LIBS" AC_DEFINE([HAVE_LIBNGHTTP2], [1], [Define if you have the nghttp2 library (-lnghttp2).]) - AC_CHECK_FUNCS([nghttp2_http2_strerror nghttp2_session_callbacks_set_error_callback]) + AC_CHECK_FUNCS([nghttp2_http2_strerror nghttp2_session_callbacks_set_error_callback nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation]) AC_CHECK_DECLS([NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL], [], [], [[#include ]]) ], diff --git a/src/crawler.c b/src/crawler.c index 8d9ef1b..0526384 100644 --- a/src/crawler.c +++ b/src/crawler.c @@ -1133,8 +1133,16 @@ static int http2_create_session(mcrawler_url *u) { memset(session_data, 0, sizeof(http2_session_data)); u->http2_session = session_data; - nghttp2_session_client_new(&session_data->session, callbacks, u); + // options + nghttp2_option *option; + nghttp2_option_new(&option); +#ifdef HAVE_NGHTTP2_OPTION_SET_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION + nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation(option, 1); +#endif + + nghttp2_session_client_new2(&session_data->session, callbacks, u, option); nghttp2_session_callbacks_del(callbacks); + nghttp2_option_del(option); // TCP NODELAY int val = 1;