Mercurial > prosody-modules
comparison mod_websocket/mod_websocket.lua @ 693:7d165cd6168c
mod_websocket: Only un-self-close <stream:stream>s
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Mon, 28 May 2012 02:18:04 +0200 |
parents | 2de21fa40382 |
children | 02fcb102b9aa |
comparison
equal
deleted
inserted
replaced
692:2de21fa40382 | 693:7d165cd6168c |
---|---|
288 data = buffer; | 288 data = buffer; |
289 buffer = ""; | 289 buffer = ""; |
290 | 290 |
291 -- COMPAT: Current client implementations send a self-closing <stream:stream> | 291 -- COMPAT: Current client implementations send a self-closing <stream:stream> |
292 if self_closing_stream then | 292 if self_closing_stream then |
293 data = data:gsub("/>$", ">"); | 293 data = data:gsub("(<stream:stream.*)/>$", "%1>"); |
294 end | 294 end |
295 | 295 |
296 data = filter("bytes/in", data); | 296 data = filter("bytes/in", data); |
297 if data then | 297 if data then |
298 local ok, err = stream:feed(data); | 298 local ok, err = stream:feed(data); |