Closed 0x00002a closed 3 years ago
Currently I can't think of any scenario where anything but the header is necessary for handing a request over to a corresponding handler. However, the handler itself of course needs access to the full request, not just the header as it might contain data that needs to be processed (think of the ws_echo
example).
Am I maybe misunderstanding the question or the scope/context of it?
ws_echo
echo's anything written to the stream after the initial connection, the oneshot echo does the same (reads once then echos and closes). I'm thinking about the request passed to the handler which is the request used by async_accept
, afaik the websocket spec says nothing about the contents of that request and only cares about the headers. Also I found this issue in beast, which suggests it is only message
to make the API easier to use (which is fair)
This can be closed, eh?
I think so, unless we want to migrate to passing header
in which I'm not sure about. It could be a bit misleading since it will always be an empty bodies request (actually I think since: #51 it is literally just a request constructed from the header) but it integrates with beast that way and I don't see any compelling reasons to change it.
Currently the full request is parsed and then handed off to the handler on the server side. I'm wondering, do we actually need to do this, or is the header enough? Is it possible that the request body could be anything but empty?