@@ -236,8 +236,12 @@ int callback_tty(struct lws *wsi, enum lws_callback_reasons reason, void *user,
236236 lwsl_warn ("refuse to serve WS client due to the --max-clients option.\n" );
237237 return 1 ;
238238 }
239- if (lws_hdr_copy (wsi , buf , sizeof (buf ), WSI_TOKEN_GET_URI ) <= 0 ||
240- strcmp (buf , endpoints .ws ) != 0 ) {
239+
240+ n = lws_hdr_copy (wsi , pss -> path , sizeof (pss -> path ), WSI_TOKEN_GET_URI );
241+ #if defined(LWS_ROLE_H2 )
242+ if (n <= 0 ) n = lws_hdr_copy (wsi , pss -> path , sizeof (pss -> path ), WSI_TOKEN_HTTP_COLON_PATH );
243+ #endif
244+ if (strncmp (pss -> path , endpoints .ws , n ) != 0 ) {
241245 lwsl_warn ("refuse to serve WS client for illegal ws path: %s\n" , buf );
242246 return 1 ;
243247 }
@@ -276,16 +280,14 @@ int callback_tty(struct lws *wsi, enum lws_callback_reasons reason, void *user,
276280 LIST_INSERT_HEAD (& server -> procs , proc , entry );
277281 server -> client_count ++ ;
278282
279- lws_hdr_copy (wsi , buf , sizeof (buf ), WSI_TOKEN_GET_URI );
280-
281283#if LWS_LIBRARY_VERSION_NUMBER >= 2004000
282284 lws_get_peer_simple (lws_get_network_wsi (wsi ), pss -> address , sizeof (pss -> address ));
283285#else
284286 char name [100 ];
285287 lws_get_peer_addresses (wsi , lws_get_socket_fd (wsi ), name , sizeof (name ), pss -> address ,
286288 sizeof (pss -> address ));
287289#endif
288- lwsl_notice ("WS %s - %s, clients: %d\n" , buf , pss -> address , server -> client_count );
290+ lwsl_notice ("WS %s - %s, clients: %d\n" , pss -> path , pss -> address , server -> client_count );
289291 break ;
290292
291293 case LWS_CALLBACK_SERVER_WRITEABLE :
0 commit comments