Commit 754357ec authored by Wandenberg's avatar Wandenberg

allways unmask the frame and check if is a valid utf8

parent 020a6882
......@@ -289,7 +289,6 @@ ngx_http_push_stream_websocket_reading(ngx_http_request_t *r)
goto exit;
}
if (cf->websocket_allow_publish && (ctx->frame->opcode == NGX_HTTP_PUSH_STREAM_WEBSOCKET_TEXT_OPCODE)) {
if (ctx->frame->mask) {
for (i = 0; i < ctx->frame->payload_len; i++) {
ctx->frame->payload[i] = ctx->frame->payload[i] ^ ctx->frame->mask_key[i % 4];
......@@ -300,6 +299,7 @@ ngx_http_push_stream_websocket_reading(ngx_http_request_t *r)
goto finalize;
}
if (cf->websocket_allow_publish && (ctx->frame->opcode == NGX_HTTP_PUSH_STREAM_WEBSOCKET_TEXT_OPCODE)) {
for (q = ngx_queue_head(&ctx->subscriber->subscriptions); q != ngx_queue_sentinel(&ctx->subscriber->subscriptions); q = ngx_queue_next(q)) {
ngx_http_push_stream_subscription_t *subscription = ngx_queue_data(q, ngx_http_push_stream_subscription_t, queue);
if (subscription->channel->for_events) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment