mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
http proxy: support PUT, PATCH and DELETE methods
This commit is contained in:
parent
3feddc06a4
commit
5747203406
1 changed files with 30 additions and 0 deletions
|
@ -1393,6 +1393,36 @@ lws_http_proxy_start(struct lws *wsi, const struct lws_http_mount *hit,
|
|||
#endif
|
||||
)
|
||||
i.method = "POST";
|
||||
else if (lws_hdr_simple_ptr(wsi, WSI_TOKEN_PUT_URI)
|
||||
#if defined(LWS_WITH_HTTP2)
|
||||
|| (
|
||||
lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP_COLON_METHOD) &&
|
||||
!strcmp(lws_hdr_simple_ptr(wsi,
|
||||
WSI_TOKEN_HTTP_COLON_METHOD), "put")
|
||||
)
|
||||
#endif
|
||||
)
|
||||
i.method = "PUT";
|
||||
else if (lws_hdr_simple_ptr(wsi, WSI_TOKEN_PATCH_URI)
|
||||
#if defined(LWS_WITH_HTTP2)
|
||||
|| (
|
||||
lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP_COLON_METHOD) &&
|
||||
!strcmp(lws_hdr_simple_ptr(wsi,
|
||||
WSI_TOKEN_HTTP_COLON_METHOD), "patch")
|
||||
)
|
||||
#endif
|
||||
)
|
||||
i.method = "PATCH";
|
||||
else if (lws_hdr_simple_ptr(wsi, WSI_TOKEN_DELETE_URI)
|
||||
#if defined(LWS_WITH_HTTP2)
|
||||
|| (
|
||||
lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP_COLON_METHOD) &&
|
||||
!strcmp(lws_hdr_simple_ptr(wsi,
|
||||
WSI_TOKEN_HTTP_COLON_METHOD), "delete")
|
||||
)
|
||||
#endif
|
||||
)
|
||||
i.method = "DELETE";
|
||||
else
|
||||
i.method = "GET";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue