MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / should_intercept

Method should_intercept

stream/interceptors.py:61–73  ·  view source on GitHub ↗

Determine if the request should be intercepted based on host and path

(host: str, path: str)

Source from the content-addressed store, hash-verified

59
60 @staticmethod
61 def should_intercept(host: str, path: str):
62 """
63 Determine if the request should be intercepted based on host and path
64 """
65 # Check if the endpoint contains GenerateContent
66 if "GenerateContent" in path or "generateContent" in path:
67 return True
68
69 # Check for jserror logging endpoint
70 if "jserror" in path:
71 return True
72
73 return False
74
75 async def process_request(
76 self, request_data: Union[int, bytes], host: str, path: str

Callers 1

process_requestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected