mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
ah-un_pos-cleanup-fix-other-path
This commit is contained in:
parent
a75a476026
commit
84f8137fa6
1 changed files with 15 additions and 1 deletions
|
@ -1105,6 +1105,7 @@ swallow:
|
|||
|
||||
if (!wsi->mux_substream && !ah->unk_pos) {
|
||||
ah->unk_pos = ah->pos;
|
||||
|
||||
#if defined(LWS_WITH_CUSTOM_HEADERS)
|
||||
/*
|
||||
* Prepare new unknown header linked-list entry
|
||||
|
@ -1283,6 +1284,9 @@ nope:
|
|||
goto forbid;
|
||||
}
|
||||
if (ah->lextable_pos < 0) {
|
||||
/*
|
||||
* It's not a header that lws knows about...
|
||||
*/
|
||||
#if defined(LWS_WITH_CUSTOM_HEADERS)
|
||||
if (!wsi->mux_substream)
|
||||
goto unknown_hdr;
|
||||
|
@ -1309,11 +1313,21 @@ nope:
|
|||
return LPR_FAIL;
|
||||
}
|
||||
|
||||
if (!wsi->mux_substream) {
|
||||
/*
|
||||
* Whether we are collecting unknown names or not,
|
||||
* if we matched an internal header we can dispense
|
||||
* with the header name part we were keeping
|
||||
*/
|
||||
ah->pos = ah->unk_pos;
|
||||
ah->unk_pos = 0;
|
||||
}
|
||||
|
||||
#if defined(LWS_ROLE_WS)
|
||||
/*
|
||||
* WSORIGIN is protocol equiv to ORIGIN,
|
||||
* JWebSocket likes to send it, map to ORIGIN
|
||||
*/
|
||||
#if defined(LWS_ROLE_WS)
|
||||
if (n == WSI_TOKEN_SWORIGIN)
|
||||
n = WSI_TOKEN_ORIGIN;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue