GRAYBYTE WORDPRESS FILE MANAGER9208

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
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/hc_python/lib/python3.12/site-packages/prometheus_client/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/hc_python/lib/python3.12/site-packages/prometheus_client//asgi.py
from typing import Callable
from urllib.parse import parse_qs

from .exposition import _bake_output
from .registry import CollectorRegistry, REGISTRY


def make_asgi_app(registry: CollectorRegistry = REGISTRY, disable_compression: bool = False) -> Callable:
    """Create a ASGI app which serves the metrics from a registry."""

    async def prometheus_app(scope, receive, send):
        assert scope.get("type") == "http"
        # Prepare parameters
        params = parse_qs(scope.get('query_string', b''))
        accept_header = ",".join([
            value.decode("utf8") for (name, value) in scope.get('headers')
            if name.decode("utf8").lower() == 'accept'
        ])
        accept_encoding_header = ",".join([
            value.decode("utf8") for (name, value) in scope.get('headers')
            if name.decode("utf8").lower() == 'accept-encoding'
        ])
        # Bake output
        status, headers, output = _bake_output(registry, accept_header, accept_encoding_header, params, disable_compression)
        formatted_headers = []
        for header in headers:
            formatted_headers.append(tuple(x.encode('utf8') for x in header))
        # Return output
        payload = await receive()
        if payload.get("type") == "http.request":
            await send(
                {
                    "type": "http.response.start",
                    "status": int(status.split(' ')[0]),
                    "headers": formatted_headers,
                }
            )
            await send({"type": "http.response.body", "body": output})

    return prometheus_app

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
May 23 2025 08:31:29
root / root
0755
__pycache__
--
April 04 2025 08:00:21
root / root
0755
bridge
--
April 04 2025 08:00:21
root / root
0755
openmetrics
--
April 04 2025 08:00:21
root / root
0755
twisted
--
April 04 2025 08:00:21
root / root
0755
__init__.py
1.772 KB
April 04 2025 08:00:21
root / root
0644
asgi.py
1.568 KB
April 04 2025 08:00:21
root / root
0644
context_managers.py
2.288 KB
April 04 2025 08:00:21
root / root
0644
core.py
0.84 KB
April 04 2025 08:00:21
root / root
0644
decorator.py
15.432 KB
April 04 2025 08:00:21
root / root
0644
exposition.py
25.563 KB
April 04 2025 08:00:21
root / root
0644
gc_collector.py
1.479 KB
April 04 2025 08:00:21
root / root
0644
metrics.py
27.45 KB
April 04 2025 08:00:21
root / root
0644
metrics_core.py
15.184 KB
April 04 2025 08:00:21
root / root
0644
mmap_dict.py
5.267 KB
April 04 2025 08:00:21
root / root
0644
multiprocess.py
7.362 KB
April 04 2025 08:00:21
root / root
0644
parser.py
7.26 KB
April 04 2025 08:00:21
root / root
0644
platform_collector.py
1.835 KB
April 04 2025 08:00:21
root / root
0644
process_collector.py
3.773 KB
April 04 2025 08:00:21
root / root
0644
py.typed
0 KB
April 04 2025 08:00:21
root / root
0644
registry.py
6.051 KB
April 04 2025 08:00:21
root / root
0644
samples.py
1.647 KB
April 04 2025 08:00:21
root / root
0644
utils.py
0.58 KB
April 04 2025 08:00:21
root / root
0644
values.py
4.885 KB
April 04 2025 08:00:21
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF