aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_component.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua
index d06df71c..a0bac298 100644
--- a/plugins/mod_component.lua
+++ b/plugins/mod_component.lua
@@ -193,6 +193,10 @@ function stream_callbacks.error(session, error, data)
end
function stream_callbacks.streamopened(session, attr)
+ if not attr.to then
+ session:close{ condition = "improper-addressing", text = "A 'to' attribute is required on stream headers" };
+ return;
+ end
if not hosts[attr.to] or not hosts[attr.to].modules.component then
session:close{ condition = "host-unknown", text = tostring(attr.to).." does not match any configured external components" };
return;