Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion homeassistant/components/webhook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from homeassistant.components import websocket_api
from homeassistant.components.http.view import HomeAssistantView
from homeassistant.components.http.const import KEY_REAL_IP
from homeassistant.const import HTTP_OK
from homeassistant.core import callback
from homeassistant.loader import bind_hass
Expand Down Expand Up @@ -71,7 +72,14 @@ async def async_handle_webhook(hass, webhook_id, request):

# Always respond successfully to not give away if a hook exists or not.
if webhook is None:
_LOGGER.warning("Received message for unregistered webhook %s", webhook_id)
peer_ip = request[KEY_REAL_IP]
_LOGGER.warning(
"Received message for unregistered webhook %s from %s", webhook_id, peer_ip
)
# Look at content to provide some context for received webhook
# Limit to 64 chars to avoid flooding the log
content = await request.content.read(64)
_LOGGER.debug("%s...", content)
return Response(status=HTTP_OK)

try:
Expand Down