From fb48bb064f47755a33846680f81a850114ae537e Mon Sep 17 00:00:00 2001 From: Davide Uberti <24529587+ubertidavide@users.noreply.github.com> Date: Wed, 20 Dec 2023 21:41:07 +0100 Subject: [PATCH] Update inspect.py --- seleniumwire/inspect.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/seleniumwire/inspect.py b/seleniumwire/inspect.py index 7e03f89..65c67ce 100644 --- a/seleniumwire/inspect.py +++ b/seleniumwire/inspect.py @@ -292,6 +292,8 @@ def request_interceptor(self) -> callable: @request_interceptor.setter def request_interceptor(self, interceptor: callable): + if len(inspect.signature(interceptor).parameters) != 1: + raise RuntimeError('A request interceptor takes one parameters: the request') self.backend.request_interceptor = interceptor @request_interceptor.deleter