INNER CODE UNIT · Python

_json

Kounex/obs_blade · tool/kick_auth_proxy/proxy.py:302

        def _json(self, status: int, message: str) -> None:
            self._send(
                status,
                json.dumps({"error": message}).encode(),
                "application/json",
            )

        def _client_ip(self) -> str:
            forwarded = self.headers.get("CF-Connecting-IP", "").strip()
            if forwarded:
                return forwarded
            return self.client_address[0]

        def _read_json(self) -> dict:
            length = int(self.headers.get("Content-Length", "0") or "0")
            if length <= 0 or length > MAX_BODY:
                raise ProxyError(400, "invalid_request")
            raw = self.rfile.read(length)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…