@@ -252,9 +252,11 @@ lws_apply_metadata(lws_ss_handle_t *h, struct lws *wsi, uint8_t *buf,
252
252
*/
253
253
254
254
if (h -> policy -> u .http .method && (
255
- (! strcmp ( h -> policy -> u . http . method , "POST" ) ||
255
+ #if defined( LWS_WITH_HTTP_UNCOMMON_HEADERS ) || defined ( LWS_HTTP_HEADERS_ALL )
256
256
!strcmp (h -> policy -> u .http .method , "PATCH" ) ||
257
- !strcmp (h -> policy -> u .http .method , "PUT" ))) &&
257
+ !strcmp (h -> policy -> u .http .method , "PUT" ) ||
258
+ #endif
259
+ (!strcmp (h -> policy -> u .http .method , "POST" ))) &&
258
260
wsi -> http .writeable_len ) {
259
261
if (!(h -> policy -> flags &
260
262
LWSSSPOLF_HTTP_NO_CONTENT_LENGTH )) {
@@ -840,8 +842,10 @@ secstream_h1(struct lws *wsi, enum lws_callback_reasons reason, void *user,
840
842
if ((h -> policy -> protocol == LWSSSP_H1 ||
841
843
h -> policy -> protocol == LWSSSP_H2 ) &&
842
844
h -> being_serialized && (
845
+ #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS ) || defined (LWS_HTTP_HEADERS_ALL )
843
846
!strcmp (h -> policy -> u .http .method , "PUT" ) ||
844
847
!strcmp (h -> policy -> u .http .method , "PATCH" ) ||
848
+ #endif
845
849
!strcmp (h -> policy -> u .http .method , "POST" ))) {
846
850
847
851
wsi -> client_suppress_CONNECTION_ERROR = 1 ;
@@ -1114,6 +1118,7 @@ secstream_h1(struct lws *wsi, enum lws_callback_reasons reason, void *user,
1114
1118
if (lws_ss_alloc_set_metadata (h , "method" , "POST" , 4 ))
1115
1119
return -1 ;
1116
1120
} else {
1121
+ #if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS ) || defined(LWS_HTTP_HEADERS_ALL )
1117
1122
m = lws_hdr_total_length (wsi , WSI_TOKEN_PATCH_URI );
1118
1123
if (m ) {
1119
1124
if (lws_ss_alloc_set_metadata (h , "path" ,
@@ -1123,6 +1128,7 @@ secstream_h1(struct lws *wsi, enum lws_callback_reasons reason, void *user,
1123
1128
if (lws_ss_alloc_set_metadata (h , "method" , "PATCH" , 5 ))
1124
1129
return -1 ;
1125
1130
}
1131
+ #endif
1126
1132
}
1127
1133
}
1128
1134
}
0 commit comments