Determine if the request should be intercepted based on host and path
(host: str, path: str)
| 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 |