관리-도구
편집 파일: wsgi.cpython-38.pyc
U �Mg* � @ s� d dl Z d dlmZ d dlZd dlmZmZ d dlmZ d dl m Z d dlmZ d dl mZmZmZ d dlmZ d d lmZ d d lmZmZ d dlmZmZmZmZ d dlmZ e�rZd d lmZ d dlmZ d dlm Z d dlm!Z! d dlm"Z" d dlm#Z# d dlm$Z$ d dlm%Z% d dlm&Z& d dl'm(Z(m)Z) e$d�Z*e$d�Z+e$d�Z,G dd� de%�Z-ed�Z.d2dd �Z/d3d"d#�Z0G d$d%� d%�Z1d4d&d'�Z2d(d)� Z3d*d+� Z4d,d-� Z5G d.d/� d/�Z6d0d1� Z7dS )5� N)�partial)�get_host�_get_headers)�continue_trace)�OP��should_send_default_pii)�DEFAULT_HTTP_METHODS_TO_CAPTURE�_filter_headers�nullcontext)� track_session)�use_isolation_scope)�Transaction�TRANSACTION_SOURCE_ROUTE)� ContextVar�capture_internal_exceptions�event_from_exception�reraise)� TYPE_CHECKING)�Callable)�Dict)�Iterator)�Any)�Tuple)�Optional)�TypeVar)�Protocol)�ExcInfo)�Event�EventProcessor�WsgiResponseIter�WsgiResponseHeaders�WsgiExcInfoc @ s e Zd Zddd�ZdS )� StartResponseNc C s d S �N� )�self�status�response_headers�exc_infor% r% �J/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/integrations/wsgi.py�__call__, s zStartResponse.__call__)N)�__name__� __module__�__qualname__r+ r% r% r% r* r# + s r# Zsentry_wsgi_middleware_applied�utf-8�replacec C s | � d��||�S )N�latin1)�encode�decode)�s�charset�errorsr% r% r* �wsgi_decoding_dance4 s r7 Fc C sV | � dd��d�}| � dd��d�}|� d|� �}d| � d�t| |�t|��d�f S )zPReturn the absolute URL without query string for the given WSGI environment.ZSCRIPT_NAME� �/Z PATH_INFOz %s://%s/%szwsgi.url_scheme)�get�rstrip�lstripr r7 )�environ�use_x_forwarded_for�script_nameZ path_info�pathr% r% r* �get_request_url9 s �rA c @ s( e Zd ZdZddefdd�Zdd� ZdS ) �SentryWsgiMiddleware��appr>