GRAYBYTE WORDPRESS FILE MANAGER5091

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django//views.py
"""
raven.contrib.django.views
~~~~~~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import

from functools import wraps

from django.conf import settings
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseBadRequest
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods

from raven.utils.compat import string_types
from raven.contrib.django.models import client
from raven.utils import json


def is_valid_origin(origin):
    if not settings.SENTRY_ALLOW_ORIGIN:
        return False

    if settings.SENTRY_ALLOW_ORIGIN == '*':
        return True

    if not origin:
        return False

    origin = origin.lower()
    for value in settings.SENTRY_ALLOW_ORIGIN:
        if isinstance(value, string_types):
            if value.lower() == origin:
                return True
        else:
            if value.match(origin):
                return True

    return False


def with_origin(func):
    @wraps(func)
    def wrapped(request, *args, **kwargs):
        origin = request.META.get('HTTP_ORIGIN')

        if not is_valid_origin(origin):
            return HttpResponseForbidden()

        response = func(request, *args, **kwargs)
        response['Access-Control-Allow-Origin'] = origin
        response['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS'

        return response
    return wrapped


def extract_auth_vars(request):
    """
    raven-js will pass both Authorization and X-Sentry-Auth depending on the browser
    and server configurations.
    """
    if request.META.get('HTTP_X_SENTRY_AUTH', '').startswith('Sentry'):
        return request.META['HTTP_X_SENTRY_AUTH']
    elif request.META.get('HTTP_AUTHORIZATION', '').startswith('Sentry'):
        return request.META['HTTP_AUTHORIZATION']
    else:
        # Try to construct from GET request
        args = [
            '%s=%s' % i
            for i in request.GET.items()
            if i[0].startswith('sentry_') and i[0] != 'sentry_data'
        ]
        if args:
            return 'Sentry %s' % ', '.join(args)
    return None


@csrf_exempt
@require_http_methods(['GET', 'POST', 'OPTIONS'])
@never_cache
@with_origin
def report(request, project_id=None):
    if request.method == 'OPTIONS':
        return HttpResponse()

    if request.method == 'POST':
        if hasattr(request, 'body'):
            data = request.body
        else:
            data = request.raw_post_data
    else:
        data = request.GET.get('sentry_data')

    if not data:
        return HttpResponseBadRequest()

    try:
        decoded = json.loads(data.decode('utf8'))
    except json.JSONDecodeError:
        return HttpResponseBadRequest()

    client.send(auth_header=extract_auth_vars(request), **decoded)

    return HttpResponse()

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 05 2024 23:48:29
root / linksafe
0755
celery
--
March 05 2024 23:48:29
root / linksafe
0755
management
--
March 05 2024 23:48:29
root / linksafe
0755
middleware
--
March 05 2024 23:48:29
root / linksafe
0755
raven_compat
--
March 05 2024 23:48:29
root / linksafe
0755
templatetags
--
March 05 2024 23:48:29
root / linksafe
0755
__init__.py
0.308 KB
October 29 2017 17:41:19
root / linksafe
0644
__init__.pyc
0.542 KB
October 18 2019 13:53:42
root / linksafe
0644
apps.py
0.301 KB
October 29 2017 17:41:19
root / linksafe
0644
apps.pyc
0.854 KB
October 18 2019 13:53:42
root / linksafe
0644
client.py
10.134 KB
October 29 2017 17:41:19
root / linksafe
0644
client.pyc
10.575 KB
October 18 2019 13:53:42
root / linksafe
0644
handlers.py
1.014 KB
October 29 2017 17:41:19
root / linksafe
0644
handlers.pyc
1.681 KB
October 18 2019 13:53:42
root / linksafe
0644
logging.py
0.455 KB
October 29 2017 17:41:19
root / linksafe
0644
logging.pyc
0.703 KB
October 18 2019 13:53:42
root / linksafe
0644
models.py
9.192 KB
October 29 2017 17:41:19
root / linksafe
0644
models.pyc
16.856 KB
October 18 2019 13:53:42
root / linksafe
0644
resolver.py
2.84 KB
October 29 2017 17:41:19
root / linksafe
0644
resolver.pyc
3.428 KB
October 18 2019 13:53:42
root / linksafe
0644
serializers.py
2.116 KB
October 29 2017 17:41:19
root / linksafe
0644
serializers.pyc
3.161 KB
October 18 2019 13:53:42
root / linksafe
0644
urls.py
0.58 KB
October 29 2017 17:41:19
root / linksafe
0644
urls.pyc
0.815 KB
October 18 2019 13:53:42
root / linksafe
0644
utils.py
3.102 KB
October 29 2017 17:41:19
root / linksafe
0644
utils.pyc
3.057 KB
October 18 2019 13:53:42
root / linksafe
0644
views.py
2.918 KB
October 29 2017 17:41:19
root / linksafe
0644
views.pyc
3.528 KB
October 18 2019 13:53:42
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF