@@ -77,6 +77,8 @@ HTTP_RESOURCE_DEFINE(resource_6, service_D, "/fo*", RES(1));
7777HTTP_RESOURCE_DEFINE (resource_7 , service_D , "/f[ob]o3.html" , RES (1 ));
7878HTTP_RESOURCE_DEFINE (resource_8 , service_D , "/fb?3.htm" , RES (0 ));
7979HTTP_RESOURCE_DEFINE (resource_9 , service_D , "/f*4.html" , RES (3 ));
80+ HTTP_RESOURCE_DEFINE (resource_11 , service_D , "/foo/*" , RES (3 ));
81+ HTTP_RESOURCE_DEFINE (resource_12 , service_D , "/foo/b?r" , RES (3 ));
8082
8183/* Default resource in case of no match */
8284static uint16_t service_E_port = 8080 ;
@@ -373,6 +375,25 @@ ZTEST(http_service, test_HTTP_RESOURCE_WILDCARD)
373375 res = CHECK_PATH (service_A , "/fbo3.htm" , & len );
374376 zassert_is_null (res , "Resource found" );
375377 zassert_equal (len , 0 , "Length set" );
378+
379+ res = CHECK_PATH (service_D , "/foo/bar" , & len );
380+ zassert_not_null (res , "Resource not found" );
381+ zassert_true (len == (sizeof ("/foo/bar" ) - 1 ), "Length not set correctly" );
382+ zassert_equal (res , RES (3 ), "Resource mismatch" );
383+
384+ res = CHECK_PATH (service_D , "/foo/bar?param=value" , & len );
385+ zassert_not_null (res , "Resource not found" );
386+ zassert_true (len == (sizeof ("/foo/bar" ) - 1 ), "Length not set correctly" );
387+ zassert_equal (res , RES (3 ), "Resource mismatch" );
388+
389+ res = CHECK_PATH (service_D , "/bar?foo=value" , & len );
390+ zassert_is_null (res , "Resource found" );
391+ zassert_equal (len , 0 , "Length set" );
392+
393+ res = CHECK_PATH (service_D , "/foo/bar?param=value" , & len );
394+ zassert_not_null (res , "Resource not found" );
395+ zassert_true (len == (sizeof ("/foo/bar" ) - 1 ), "Length not set correctly" );
396+ zassert_equal (res , RES (3 ), "Resource mismatch" );
376397}
377398
378399ZTEST (http_service , test_HTTP_RESOURCE_DEFAULT )
0 commit comments