Instructs the mock server to only accept requests via the proxy.
(self, value: bool = True)
| 125 | ) |
| 126 | |
| 127 | def expect_proxy(self, value: bool = True): |
| 128 | """Instructs the mock server to only accept requests via the |
| 129 | proxy.""" |
| 130 | if self.is_mock_server: |
| 131 | self.headers["mock-server-session-expect-proxy"] = ( |
| 132 | "1" if value else "0" |
| 133 | ) |
| 134 | |
| 135 | return Server() |
| 136 |