Loading libraries/robotframework-httpctrl/src/HttpCtrl/http_stub.py +12 −9 Original line number Diff line number Diff line Loading @@ -151,15 +151,18 @@ class HttpStubContainer(metaclass=Singleton): return False return True # we should check if an id is into the url if "urn" in stub.criteria.url: stub_url = stub.criteria.url.split("/") id = stub_url[-1].split(":") for elements in id: if elements not in (criteria.url): return False # Stub registered without parameters; brokers may append # optional parameters to the forward (sysAttrs, pick, ...). # Match on the exact PATH, ignoring the request's query # string. The previous urn-segment heuristic never compared # the path prefix, so a /broker2/... request matched the # /broker1/... stub whenever both targeted the same entity # id -- the first stub swallowed every forward and its # sibling starved (D010_01_red counts 2/0, and the merge # never saw broker2's body). from urllib.parse import unquote if unquote(stub.criteria.url).rstrip("/") == unquote(criteria_url_components[0]).rstrip("/"): return True else: return False # if the method is not GET, we should ignore parameters and check if the url is the same Loading Loading
libraries/robotframework-httpctrl/src/HttpCtrl/http_stub.py +12 −9 Original line number Diff line number Diff line Loading @@ -151,15 +151,18 @@ class HttpStubContainer(metaclass=Singleton): return False return True # we should check if an id is into the url if "urn" in stub.criteria.url: stub_url = stub.criteria.url.split("/") id = stub_url[-1].split(":") for elements in id: if elements not in (criteria.url): return False # Stub registered without parameters; brokers may append # optional parameters to the forward (sysAttrs, pick, ...). # Match on the exact PATH, ignoring the request's query # string. The previous urn-segment heuristic never compared # the path prefix, so a /broker2/... request matched the # /broker1/... stub whenever both targeted the same entity # id -- the first stub swallowed every forward and its # sibling starved (D010_01_red counts 2/0, and the merge # never saw broker2's body). from urllib.parse import unquote if unquote(stub.criteria.url).rstrip("/") == unquote(criteria_url_components[0]).rstrip("/"): return True else: return False # if the method is not GET, we should ignore parameters and check if the url is the same Loading