dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/onomondo-eim/+/43086?usp=email )


Change subject: esipa_middleware: log incompatible requests
......................................................................

esipa_middleware: log incompatible requests

The esipa_middleware filters incompatible requests by their protocol
version (X-ADMIN-PROTOCOL), but there is no error logged in that
case. Let's make sure that incompatible requests are brought to the
operator's attention.

Related: SYS#8100
Change-Id: Icadc2434794cbd0f7205181a8d506e1d24ee9d0d
---
M src/esipa_middleware.erl
1 file changed, 5 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/86/43086/1

diff --git a/src/esipa_middleware.erl b/src/esipa_middleware.erl
index e7a7769..3f1e82d 100644
--- a/src/esipa_middleware.erl
+++ b/src/esipa_middleware.erl
@@ -16,7 +16,11 @@
     case cowboy_req:header(<<"x-admin-protocol">>, Req0) of
         <<"gsma/rsp/v2.1.0">> ->
             {ok, Req0, State};
-        _ ->
+        Protocol ->
+            logger:error(
+                "Rejecting incompatible ESipa request: ~s,~nProtocol=~p, 
Peer=~p, Pid=~p~n",
+                [maps:get(path, Req0), Protocol, maps:get(peer, Req0), 
maps:get(pid, Req0)]
+            ),
             Req = cowboy_req:reply(400, #{}, <<"Unsupported 
x-admin-protocol">>, Req0),
             {stop, Req}
     end;

--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/43086?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: Icadc2434794cbd0f7205181a8d506e1d24ee9d0d
Gerrit-Change-Number: 43086
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>

Reply via email to