Method
create
(
local_utils: LocalUtils,
file: str,
not_found_action: RouteFromHarNotFoundPolicy,
url_matcher: Optional[URLMatch] = None,
)
Source from the content-addressed store, hash-verified
| 44 | |
| 45 | @staticmethod |
| 46 | async def create( |
| 47 | local_utils: LocalUtils, |
| 48 | file: str, |
| 49 | not_found_action: RouteFromHarNotFoundPolicy, |
| 50 | url_matcher: Optional[URLMatch] = None, |
| 51 | ) -> "HarRouter": |
| 52 | har_id = await local_utils._channel.send("harOpen", None, {"file": file}) |
| 53 | return HarRouter( |
| 54 | local_utils=local_utils, |
| 55 | har_id=har_id, |
| 56 | not_found_action=not_found_action, |
| 57 | url_matcher=url_matcher, |
| 58 | ) |
| 59 | |
| 60 | async def _handle(self, route: "Route") -> None: |
| 61 | request = route.request |