� <��g����ddlZddlmZddlmZmZmZddlm Z Gd�de��Z Gd�d e��Z Gd �d e��Z dS) �N�)�datastructures)�InvalidHandshake�InvalidMessage� ProtocolError)� StatusLikec�<�eZdZdZdedejddfd�Zdefd�Z dS)�InvalidStatusCodezC Raised when a handshake response status code is invalid. � status_code�headers�returnNc�"�||_||_dS�N)r r )�selfr r s �l/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/websockets/legacy/exceptions.py�__init__zInvalidStatusCode.__init__s��&����� � � �c��d|j��S)Nz+server rejected WebSocket connection: HTTP )r �rs r�__str__zInvalidStatusCode.__str__s��O�T�=M�O�O�Or) �__name__� __module__� __qualname__�__doc__�intr�Headersr�strr�rrr r sl�������� �C��.�2H��T�����P��P�P�P�P�P�Prr c �D�eZdZdZ d dedejdeddfd�Zde fd �Z dS) �AbortHandshakea� Raised to abort the handshake on purpose and return an HTTP response. This exception is an implementation detail. The public API is :meth:`~websockets.legacy.server.WebSocketServerProtocol.process_request`. Attributes: status (~http.HTTPStatus): HTTP status code. headers (Headers): HTTP response headers. body (bytes): HTTP response body. r�statusr �bodyr Nc�x�tj|��|_tj|��|_||_dSr)�http� HTTPStatusr!rrr r")rr!r r"s rrzAbortHandshake.__init__*s2���o�f�-�-�� �%�-�g�6�6�� ��� � � rc�n�d|jd�dt|j���dt|j���d�S)NzHTTP �dz, z headers, z bytes)r!�lenr r"rs rrzAbortHandshake.__str__5s<�� X�D�K� X� X� X�S���%6�%6� X� X�#�d�i�.�.� X� X� X� r)r) rrrrrr� HeadersLike�bytesrrrrrrr r s������� � �$� � �� � �+� �� � � � � � � �� � � � � � rr c�.�eZdZdZdeddfd�Zdefd�ZdS)�RedirectHandshakezd Raised when a handshake gets redirected. This exception is an implementation detail. �urir Nc��||_dSr�r-)rr-s rrzRedirectHandshake.__init__Cs ������rc��d|j��S)Nz redirect to r/rs rrzRedirectHandshake.__str__Fs��(�d�h�(�(�(r)rrrrrrrrrrr,r,;s[���������C��D�����)��)�)�)�)�)�)rr,) r$�r� exceptionsrrr�WebSocketProtocolError�typingrr r r,rrr�<module>r5s��� � � � �����������������  ������ P� P� P� P� P�(� P� P� P� � � � � �%� � � �@ )� )� )� )� )�(� )� )� )� )� )r
Memory